jopt.csp.variable
Interface CspSetVariable

All Superinterfaces:
CspVariable
All Known Subinterfaces:
CspIntSetVariable

public interface CspSetVariable
extends CspVariable

Base interface class for set based variables


Method Summary
 void addRequired(java.lang.Object req)
          Adds a required value to the set of required values
 void addRequired(java.util.Set req)
          Adds a set of required values
 java.lang.String getName()
          Returns the name of the variable
 int getPossibleCardinality()
          Returns the cardinality of the set of possible values
 java.util.Set getPossibleSet()
          Returns the possible set of values in this variable's domain
 int getRequiredCardinality()
          Returns the cardinality of the set of required values
 java.util.Set getRequiredSet()
          Returns the required set of values in this variable's domain
 int getSize()
          Returns 1 + (cardinality of possible) - (cardinality of required)
 boolean isInDomain(java.lang.Object val)
          Returns true if the specified value is in this variable's domain
 boolean isPossible(java.lang.Object value)
          Returns true if the specified value is in the set of possible values
 boolean isRequired(java.lang.Object value)
          Returns true if the specified value is in the set of required values
 void removePossible(java.lang.Object value)
          Removes a value from the possible set
 void removePossible(java.util.Set values)
          Removes a set of values from the possible set
 void setName(java.lang.String name)
          Sets the name of the variable
 
Methods inherited from interface jopt.csp.variable.CspVariable
isBound
 

Method Detail

getName

public java.lang.String getName()
Returns the name of the variable

Specified by:
getName in interface CspVariable
Returns:
name of this variable

setName

public void setName(java.lang.String name)
Sets the name of the variable

Parameters:
name - new name for this variable

getPossibleSet

public java.util.Set getPossibleSet()
Returns the possible set of values in this variable's domain

Returns:
set of possible values

getRequiredSet

public java.util.Set getRequiredSet()
Returns the required set of values in this variable's domain

Returns:
set of required values

getPossibleCardinality

public int getPossibleCardinality()
Returns the cardinality of the set of possible values

Returns:
number of items in the possible set

getRequiredCardinality

public int getRequiredCardinality()
Returns the cardinality of the set of required values

Returns:
number of items in required set

getSize

public int getSize()
Returns 1 + (cardinality of possible) - (cardinality of required)

Specified by:
getSize in interface CspVariable
Returns:
1 + (cardinality of possible) - (cardinality of required)

addRequired

public void addRequired(java.lang.Object req)
                 throws PropagationFailureException
Adds a required value to the set of required values

Parameters:
req - object to add to required set
Throws:
PropagationFailureException

isInDomain

public boolean isInDomain(java.lang.Object val)
Returns true if the specified value is in this variable's domain

Parameters:
val - object being inquired about
Returns:
true if val is in domain

isRequired

public boolean isRequired(java.lang.Object value)
Returns true if the specified value is in the set of required values

Parameters:
value - object being inquired about
Returns:
true if val is set of required

isPossible

public boolean isPossible(java.lang.Object value)
Returns true if the specified value is in the set of possible values

Parameters:
value - object being inquired about
Returns:
true if val is set of required

removePossible

public void removePossible(java.lang.Object value)
                    throws PropagationFailureException
Removes a value from the possible set

Parameters:
value - object to be removed from possible
Throws:
PropagationFailureException

removePossible

public void removePossible(java.util.Set values)
                    throws PropagationFailureException
Removes a set of values from the possible set

Parameters:
values - set of value to be removed from possible
Throws:
PropagationFailureException

addRequired

public void addRequired(java.util.Set req)
                 throws PropagationFailureException
Adds a set of required values

Parameters:
req - set of value to be added to required
Throws:
PropagationFailureException