choco.kernel.model.variables.set
Class SetVariable

java.lang.Object
  extended by choco.kernel.model.VariableArray
      extended by choco.kernel.model.ModelObject
          extended by choco.kernel.model.variables.AbstractVariable
              extended by choco.kernel.model.variables.ComponentVariable
                  extended by choco.kernel.model.variables.set.SetExpressionVariable
                      extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from class choco.kernel.model.variables.ComponentVariable
ComponentVariable.ConstraintsDataStructure
 
Nested classes/interfaces inherited from class choco.kernel.model.VariableArray
VariableArray.VConstraintsDataStructure
 
Field Summary
protected  IntegerVariable card
           
protected  int[] values
           
 
Fields inherited from class choco.kernel.model.variables.set.SetExpressionVariable
lowB, uppB
 
Fields inherited from class choco.kernel.model.variables.ComponentVariable
expressionManager, NO_CONSTRAINTS_DS, operator, parameters, variableManager
 
Fields inherited from class choco.kernel.model.variables.AbstractVariable
name, type
 
Fields inherited from class choco.kernel.model.VariableArray
NO_CONSTRAINTS
 
Fields inherited from interface choco.kernel.model.variables.Variable
LOGGER
 
Fields inherited from interface choco.kernel.model.variables.IHook
NO_HOOK
 
Constructor Summary
  SetVariable(String name, int[] values, IntegerVariable card)
           
  SetVariable(String name, int lowB, int uppB, IntegerVariable card)
           
protected SetVariable(VariableType variableType, boolean enableOption, int[] parameter, IConstraintList constraints, IntegerVariable card)
           
 
Method Summary
 void addOption(String options)
          Add an option to the pool of option.
 Variable[] doExtractVariables()
          Extract first level sub-variables of a variable and return an array of non redundant sub-variable.
 IntegerVariable getCard()
           
 int[] getValues()
           
 String pretty()
          pretty printing of the object.
 void setCard(IntegerVariable card)
           
 
Methods inherited from class choco.kernel.model.variables.set.SetExpressionVariable
getExpressionVariable, getLowB, getUppB, setLowB, setUppB
 
Methods inherited from class choco.kernel.model.variables.ComponentVariable
findManager, getComponentClass, getConstraintManager, getExpressionManager, getOperator, getOperatorClass, getParameters, getVariableManager
 
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.ModelObject
addOptions, addOptions, addOptions, addOptions, containsOption, getIndex, getOptions, hashCode
 
Methods inherited from class choco.kernel.model.VariableArray
cancelExtractVariables, extractVariables, forceExtractVariables, getNbVars, getVariable, getVariableIterator, getVariables, replaceBy, replaceByConstantAt, setVariables, setVariables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface choco.kernel.model.IVariableArray
extractVariables, getNbVars, getVariable, getVariableIterator, getVariables, replaceBy
 
Methods inherited from interface choco.kernel.common.IIndex
getIndex
 
Methods inherited from interface choco.kernel.model.IOptions
addOptions, addOptions, addOptions, addOptions, containsOption, getOptions
 

Field Detail

values

protected int[] values

card

protected IntegerVariable card
Constructor Detail

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)
Method Detail

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.