|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.constraints.impl.CommonBase
javax.constraints.impl.AbstractConstrainedVariable
javax.constraints.impl.BasicVarSet
public class BasicVarSet
This class represents a basic implementation of constrained set variables.
| Constructor Summary | |
|---|---|
BasicVarSet(Problem problem,
int[] values,
java.lang.String name)
|
|
BasicVarSet(Problem problem,
int min,
int max,
java.lang.String name)
|
|
BasicVarSet(Problem problem,
java.util.Set set,
java.lang.String name)
|
|
| Method Summary | |
|---|---|
boolean |
contains(java.util.Set setOfValues)
|
Constraint |
doNotIntersectWith(VarSet varSet)
|
Var |
getCardinality()
|
java.util.Set |
getPossibleSet()
|
java.util.Set |
getRequiredSet()
|
Var |
getRequiredVar(int value)
|
Var[] |
getRequiredVars()
|
java.util.Set |
getValue()
|
java.util.Set |
getValueSet()
|
void |
init()
|
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 value)
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 set)
Instantiates this set variable with the constant "set" of integers. |
java.lang.String |
toString()
|
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 class javax.constraints.impl.CommonBase |
|---|
getImpl, getName, getObject, getProblem, setImpl, setName, setObject |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.constraints.ConstrainedVariable |
|---|
getImpl, getName, getObject, getProblem, setImpl, setName, setObject |
| Constructor Detail |
|---|
public BasicVarSet(Problem problem,
int[] values,
java.lang.String name)
throws java.lang.Exception
java.lang.Exception
public BasicVarSet(Problem problem,
int min,
int max,
java.lang.String name)
throws java.lang.Exception
java.lang.Exception
public BasicVarSet(Problem problem,
java.util.Set set,
java.lang.String name)
throws java.lang.Exception
java.lang.Exception| Method Detail |
|---|
public boolean contains(java.util.Set setOfValues)
contains in interface VarSet
public Constraint doNotIntersectWith(VarSet varSet)
throws java.lang.Exception
java.lang.Exceptionpublic Var getCardinality()
getCardinality in interface VarSetpublic java.util.Set getPossibleSet()
getPossibleSet in interface VarSetpublic java.util.Set getRequiredSet()
getRequiredSet in interface VarSet
public Var getRequiredVar(int value)
throws java.lang.Exception
java.lang.Exceptionpublic Var[] getRequiredVars()
public java.util.Set getValue()
throws java.lang.Exception
getValue in interface VarSetjava.lang.Exception - if this set variable in not boundpublic java.util.Set getValueSet()
public void init()
throws java.lang.Exception
java.lang.Exception
public VarSet intersection(VarSet varSet)
throws java.lang.Exception
VarSet
intersection in interface VarSetjava.lang.Exceptionpublic boolean isBound()
isBound in interface VarSetpublic boolean isPossible(int value)
isPossible in interface VarSetpublic boolean isRequired(int value)
isRequired in interface VarSet
public void remove(int value)
throws java.lang.Exception
VarSet
remove in interface VarSetjava.lang.Exception
public void require(int value)
throws java.lang.Exception
VarSet
require in interface VarSetjava.lang.Exception - if the value is outside of the possible setpublic void setEmpty(boolean flag)
VarSet
setEmpty in interface VarSet
public void setValue(java.util.Set set)
throws java.lang.Exception
VarSet
setValue in interface VarSetjava.lang.Exception - if some values in the "set' are not possiblepublic java.lang.String toString()
toString in class java.lang.Objectpublic VarSet union(VarSet varSet)
VarSet
union in interface VarSet
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||