Package org.jacop.core
Class MutableDomain
- java.lang.Object
-
- org.jacop.core.MutableDomain
-
- All Implemented Interfaces:
Stateful,MutableVar
public class MutableDomain extends java.lang.Object implements MutableVar
- Version:
- 4.8
-
-
Constructor Summary
Constructors Constructor Description MutableDomain(Store store)MutableDomain(Store store, IntDomain domain)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) intindex()MutableVarValueprevious()It returns the earlier value of variable comparing to the current one.voidremoveLevel(int removeLevel)This function is called in case of the backtrack, so a constraint can clear the queue of changed variables which is no longer valid.voidsetCurrent(MutableVarValue o)It replace the current representation of the value with a new representation.(package private) intstamp()java.lang.StringtoString()It returns string representation of Mutable variable.voidupdate(MutableVarValue val)It updates the value of a mutable variable based on value given as a parameter, the stamp level of current value and stamp value of passed value.MutableVarValuevalue()It returns current value of MutableVariable.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jacop.api.Stateful
isStateful
-
-
-
-
Field Detail
-
debug
public static final boolean debug
It specifies if debugging info should be printed out.- See Also:
- Constant Field Values
-
index
int index
-
store
Store store
-
value
MutableDomainValue value
-
-
Constructor Detail
-
MutableDomain
public MutableDomain(Store store)
- Parameters:
store- store in which the mutable domain is created.
-
-
Method Detail
-
index
int index()
-
previous
public MutableVarValue previous()
Description copied from interface:MutableVarIt returns the earlier value of variable comparing to the current one.- Specified by:
previousin interfaceMutableVar- Returns:
- previous value of a mutable variable.
-
removeLevel
public void removeLevel(int removeLevel)
Description copied from interface:StatefulThis function is called in case of the backtrack, so a constraint can clear the queue of changed variables which is no longer valid. This function is called *before* all timestamps, variables, mutablevariables have reverted to their previous value.- Specified by:
removeLevelin interfaceStateful- Parameters:
removeLevel- the level which is being removed.
-
setCurrent
public void setCurrent(MutableVarValue o)
Description copied from interface:MutableVarIt replace the current representation of the value with a new representation. It ignores the store level.- Specified by:
setCurrentin interfaceMutableVar- Parameters:
o- value to which a mutable variable is set.
-
stamp
int stamp()
-
toString
public java.lang.String toString()
Description copied from interface:MutableVarIt returns string representation of Mutable variable.- Specified by:
toStringin interfaceMutableVar- Overrides:
toStringin classjava.lang.Object
-
update
public void update(MutableVarValue val)
Description copied from interface:MutableVarIt updates the value of a mutable variable based on value given as a parameter, the stamp level of current value and stamp value of passed value.- Specified by:
updatein interfaceMutableVar- Parameters:
val- it specifies the new value of a mutable variable.
-
value
public MutableVarValue value()
Description copied from interface:MutableVarIt returns current value of MutableVariable.- Specified by:
valuein interfaceMutableVar- Returns:
- current value of the mutable variable.
-
-