choco.kernel.model.variables.integer
Class IntegerVariable
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.integer.IntegerExpressionVariable
choco.kernel.model.variables.integer.IntegerVariable
- All Implemented Interfaces:
- IPretty, IIndex, IConstraintList, IFindManager, IOptions, IVariableArray, IHook, IntBoundedVariable, Variable, Serializable, Comparable
- Direct Known Subclasses:
- IntegerConstantVariable
public class IntegerVariable
- extends IntegerExpressionVariable
- 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
_iterator
protected IVIterator _iterator
IntegerVariable
protected IntegerVariable(VariableType variableType,
int[] parameters,
boolean enableOption,
IConstraintList constraints)
IntegerVariable
public IntegerVariable(String name,
int binf,
int bsup)
IntegerVariable
public IntegerVariable(String name,
int[] theValues)
getValues
public final int[] getValues()
getDomainSize
public final int getDomainSize()
canBeEqualTo
public final boolean canBeEqualTo(int v)
isBoolean
public final boolean isBoolean()
isConstant
public final boolean isConstant()
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
getDomainIterator
public final DisposableIntIterator getDomainIterator()
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.
removeVal
public final void removeVal(int remvalue)
enumVal
public final int[] enumVal()
- Return the enumerated values of a domain
- Returns:
- the enumerated values of a domain
Copyright © 2012. All Rights Reserved.