|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface VarSet
This interface represents a constrained set variable which, when bound, is equal to a set of elements. The domain of a constrained set variable is a set of Sets that consist of regular integers.
The domain of a constrained set variable defines two sets:
The cardinality of a set constrained variable is an integer constrained variable.
You may define set intersections and unions.
See also Problem#elementAt(Set[], Var)
| Method Summary | |
|---|---|
boolean |
contains(java.util.Set<java.lang.Integer> setOfValues)
|
Var |
getCardinality()
|
java.util.Set<java.lang.Integer> |
getPossibleSet()
|
java.util.Set<java.lang.Integer> |
getRequiredSet()
|
java.util.Set<java.lang.Integer> |
getValue()
|
VarSet |
intersection(VarSet varSet)
Creates a new set variable that is an intersection of this set variable with the "varSet" passed as a parameter. |
boolean |
isBound()
|
boolean |
isPossible(int value)
|
boolean |
isRequired(int value)
|
void |
remove(int value)
Removes the "value' from the possible set |
void |
require(int val)
Adds the "value" to the required set |
void |
setEmpty(boolean flag)
Sets the cardinality of this set variable to be equals 0 if the flag is true, and to be more or equal 1 if the flag is false. |
void |
setValue(java.util.Set<java.lang.Integer> set)
Instantiates this set variable with the constant "set" of integers. |
VarSet |
union(VarSet varSet)
Creates a new set variable that is an union of this set variable with the "varSet" passed as a parameter. |
| Methods inherited from interface javax.constraints.ConstrainedVariable |
|---|
getImpl, getName, getObject, getProblem, setImpl, setName, setObject |
| Method Detail |
|---|
boolean contains(java.util.Set<java.lang.Integer> setOfValues)
setOfValues -
Var getCardinality()
java.util.Set<java.lang.Integer> getPossibleSet()
java.util.Set<java.lang.Integer> getRequiredSet()
java.util.Set<java.lang.Integer> getValue()
throws java.lang.Exception
java.lang.Exception - if this set variable in not bound
VarSet intersection(VarSet varSet)
throws java.lang.Exception
varSet -
java.lang.Exceptionboolean isBound()
boolean isPossible(int value)
boolean isRequired(int value)
void remove(int value)
throws java.lang.Exception
value -
java.lang.Exception
void require(int val)
throws java.lang.Exception
val -
java.lang.Exception - if the value is outside of the possible setvoid setEmpty(boolean flag)
flag -
void setValue(java.util.Set<java.lang.Integer> set)
throws java.lang.Exception
set -
java.lang.Exception - if some values in the "set' are not possible
VarSet union(VarSet varSet)
throws java.lang.Exception
varSet -
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||