|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.memory.trailing.AbstractStoredObject
choco.kernel.memory.trailing.StoredInt
public class StoredInt
A class implementing backtrackable integers.
Field Summary | |
---|---|
protected StoredIntTrail |
myTrail
|
Fields inherited from class choco.kernel.memory.trailing.AbstractStoredObject |
---|
environment, LOGGER, worldStamp |
Fields inherited from interface choco.kernel.memory.IStateInt |
---|
MAXINT, MININT, UNKNOWN_INT |
Constructor Summary | |
---|---|
StoredInt(EnvironmentTrailing env,
int i)
Constructs a stored search with an initial value. |
Method Summary | |
---|---|
void |
_set(int y,
int wstamp)
Modifies the value without storing the former value on the trailing stack. |
int |
add(int delta)
Modifying a StoredInt by an increment. |
int |
decrement()
Modifying a StoredInt by subtracting an unit increment. |
int |
get()
Returns the current value according to the current world. |
int |
increment()
Modifying a StoredInt by adding an unit increment. |
void |
set(int y)
Modifies the value and stores if needed the former value on the trailing stack. |
String |
toString()
|
Methods inherited from class choco.kernel.memory.trailing.AbstractStoredObject |
---|
getEnvironment, getWorldStamp, setWorldStamp |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface choco.kernel.memory.IStateInt |
---|
getEnvironment |
Field Detail |
---|
protected final StoredIntTrail myTrail
Constructor Detail |
---|
public StoredInt(EnvironmentTrailing env, int i)
Method Detail |
---|
public final int add(int delta)
IStateInt
add
in interface IStateInt
delta
- the value to add to the current value.
public int increment()
IStateInt
increment
in interface IStateInt
public int decrement()
IStateInt
decrement
in interface IStateInt
public final int get()
IStateInt
get
in interface IStateInt
public final void set(int y)
set
in interface IStateInt
y
- the new value of the variable.public void _set(int y, int wstamp)
y
- the new valuewstamp
- the stamp of the world in which the update is performedpublic final String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |