choco.kernel.model.variables.integer
Class IntegerConstantVariable

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.integer.IntegerExpressionVariable
                      extended by choco.kernel.model.variables.integer.IntegerVariable
                          extended by choco.kernel.model.variables.integer.IntegerConstantVariable
All Implemented Interfaces:
IPretty, IIndex, IConstraintList, IFindManager, IOptions, IVariableArray, IHook, IntBoundedVariable, Variable, Serializable, Comparable

public final class IntegerConstantVariable
extends IntegerVariable

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
 
Fields inherited from class choco.kernel.model.variables.integer.IntegerVariable
_iterator, values
 
Fields inherited from class choco.kernel.model.variables.integer.IntegerExpressionVariable
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
IntegerConstantVariable(int value)
           
 
Method Summary
 int compareTo(Object o)
          Compares this object with the specified object for order.
 boolean equals(Object o)
           
 int getValue()
           
 String pretty()
          pretty printing of the object.
 void setLowB(int lowB)
           
 void setUppB(int uppB)
           
 
Methods inherited from class choco.kernel.model.variables.integer.IntegerVariable
canBeEqualTo, doExtractVariables, enumVal, getDomainIterator, getDomainSize, getValues, isBoolean, isConstant, removeVal
 
Methods inherited from class choco.kernel.model.variables.integer.IntegerExpressionVariable
getExpressionVariable, getLowB, getUppB
 
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, getConstraint, getConstraintIterator, getConstraintIterator, getConstraints, getHook, getName, getNbConstraint, getNbConstraint, getVariableType, removeConstraints, resetHook, setHook, setName, throwConstantException, toString
 
Methods inherited from class choco.kernel.model.ModelObject
addOption, 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, 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
addOption, addOptions, addOptions, addOptions, addOptions, containsOption, getOptions
 

Constructor Detail

IntegerConstantVariable

public IntegerConstantVariable(int value)
Method Detail

getValue

public int getValue()

setLowB

public void setLowB(int lowB)
Specified by:
setLowB in interface IntBoundedVariable
Overrides:
setLowB in class IntegerExpressionVariable

setUppB

public void setUppB(int uppB)
Specified by:
setUppB in interface IntBoundedVariable
Overrides:
setUppB in class IntegerExpressionVariable

equals

public boolean equals(Object o)
Overrides:
equals in class Object

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 IntegerVariable
Returns:
a readable string representation of the object

compareTo

public int compareTo(Object o)
Description copied from class: AbstractVariable
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception iff y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y)>0 && y.compareTo(z)>0) implies x.compareTo(z)>0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for all z.

It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals."

In the foregoing description, the notation sgn(expression) designates the mathematical signum function, which is defined to return one of -1, 0, or 1 according to whether the value of expression is negative, zero or positive.

Specified by:
compareTo in interface Comparable
Overrides:
compareTo in class AbstractVariable
Parameters:
o - the object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.


Copyright © 2012. All Rights Reserved.