|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectJaCoP.core.TimeStamp<T>
T - a class being stored at different time stamps.public class TimeStamp<T>
This class provides mutable variable functionality. The variable value depends on the store level. Each value is time stamped with different store level. This class lets you avoid recomputation every time a solver backtracks. It will simply use the value with older time stamp. It is appropriate for objects which do not share data across store levels. If you have objects which share data across store levels than you need to make your own implementation of mutable variable using MutableVar interface. It will (it has to) store the same object at different levels as users of the timestamp may ask for the level at which the timestamp was recently updated.
| Constructor Summary | |
|---|---|
TimeStamp(Store store,
T input)
The constructor. |
|
| Method Summary | |
|---|---|
void |
ensureCapacity(int minCapacity)
Specify least number of different values to be used by Timestamp. |
T |
previousValue()
|
void |
remove(int stamp)
The function removes the level specified by the stamp. |
int |
stamp()
It returns the value of the most recent stamp used within that timestamp. |
java.lang.String |
toString()
|
void |
update(T val)
It updates the value of the timestamp with the provided value. |
T |
value()
It returns the most recent value of the timestamp. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TimeStamp(Store store,
T input)
store - the store where the timestamp is registered.input - the value of the stamp to be stored.| Method Detail |
|---|
public void ensureCapacity(int minCapacity)
minCapacity - public final T previousValue()
public void remove(int stamp)
stamp - the number of the level.public final int stamp()
public java.lang.String toString()
toString in class java.lang.Objectpublic void update(T val)
val - value to which the timestamp needs to be updated.public final T value()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||