choco.kernel.model.variables.set
Class SetVariable
java.lang.Object
choco.kernel.model.VariableArray
choco.kernel.model.ModelObject
choco.kernel.model.variables.AbstractVariable
choco.kernel.model.variables.ComponentVariable
choco.kernel.model.variables.set.SetExpressionVariable
choco.kernel.model.variables.set.SetVariable
- All Implemented Interfaces:
- IPretty, IIndex, IConstraintList, IFindManager, IOptions, IVariableArray, IHook, IntBoundedVariable, Variable, Serializable, Comparable
- Direct Known Subclasses:
- SetConstantVariable
public class SetVariable
- extends SetExpressionVariable
- See Also:
- Serialized Form
Fields inherited from interface choco.kernel.model.variables.Variable |
LOGGER |
Fields inherited from interface choco.kernel.model.variables.IHook |
NO_HOOK |
Methods inherited from class choco.kernel.model.variables.AbstractVariable |
_addConstraint, _contains, _removeConstraint, compareTo, getConstraint, getConstraintIterator, getConstraintIterator, getConstraints, getHook, getName, getNbConstraint, getNbConstraint, getVariableType, removeConstraints, resetHook, setHook, setName, throwConstantException, toString |
Methods inherited from class choco.kernel.model.VariableArray |
cancelExtractVariables, extractVariables, forceExtractVariables, getNbVars, getVariable, getVariableIterator, getVariables, replaceBy, replaceByConstantAt, setVariables, setVariables |
values
protected int[] values
card
protected IntegerVariable card
SetVariable
protected SetVariable(VariableType variableType,
boolean enableOption,
int[] parameter,
IConstraintList constraints,
IntegerVariable card)
SetVariable
public SetVariable(String name,
int lowB,
int uppB,
IntegerVariable card)
SetVariable
public SetVariable(String name,
int[] values,
IntegerVariable card)
getCard
public final IntegerVariable getCard()
- Returns:
- the card
setCard
public final void setCard(IntegerVariable card)
- Parameters:
card
- the card to set
getValues
public int[] getValues()
pretty
public String pretty()
- pretty printing of the object. This String is not constant and may depend on the context.
- Specified by:
pretty
in interface IPretty
- Overrides:
pretty
in class AbstractVariable
- Returns:
- a readable string representation of the object
addOption
public void addOption(String options)
- Description copied from interface:
IOptions
- Add an option to the pool of option.
- Specified by:
addOption
in interface IOptions
- Overrides:
addOption
in class ModelObject
doExtractVariables
public Variable[] doExtractVariables()
- Extract first level sub-variables of a variable
and return an array of non redundant sub-variable.
In simple variable case, return a an array
with just one element.
Really usefull when expression variables.
- Overrides:
doExtractVariables
in class VariableArray
- Returns:
- a hashset of every sub variables contained in the Variable.
Copyright © 2012. All Rights Reserved.