choco.mem
Class StoredLongTrail

java.lang.Object
  extended by choco.mem.StoredLongTrail
All Implemented Interfaces:
ITrailStorage

public class StoredLongTrail
extends java.lang.Object
implements ITrailStorage


Constructor Summary
StoredLongTrail(Environment env, int nUpdates, int nWorlds)
          Constructs a trail with predefined size.
 
Method Summary
 int getSize()
          Returns the current size of the stack.
 void resizeWorldCapacity(int newWorldCapacity)
          increase the capacity of the environment to a given number of worlds
 void savePreviousState(StoredLong v, long oldValue, int oldStamp)
          Reacts when a StoredInt is modified: push the former value & timestamp on the stacks.
 void worldCommit()
          Comits a world: merging it with the previous one.
 void worldPop()
          Moving down to the previous world.
 void worldPush()
          Moving up to the next world.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoredLongTrail

public StoredLongTrail(Environment env,
                       int nUpdates,
                       int nWorlds)
Constructs a trail with predefined size.

Parameters:
nUpdates - maximal number of updates that will be stored
nWorlds - maximal number of worlds that will be stored
Method Detail

worldPush

public void worldPush()
Moving up to the next world.

Specified by:
worldPush in interface ITrailStorage

worldPop

public void worldPop()
Moving down to the previous world.

Specified by:
worldPop in interface ITrailStorage

getSize

public int getSize()
Returns the current size of the stack.

Specified by:
getSize in interface ITrailStorage

worldCommit

public void worldCommit()
Comits a world: merging it with the previous one.

Specified by:
worldCommit in interface ITrailStorage

savePreviousState

public void savePreviousState(StoredLong v,
                              long oldValue,
                              int oldStamp)
Reacts when a StoredInt is modified: push the former value & timestamp on the stacks.


resizeWorldCapacity

public void resizeWorldCapacity(int newWorldCapacity)
Description copied from interface: ITrailStorage
increase the capacity of the environment to a given number of worlds

Specified by:
resizeWorldCapacity in interface ITrailStorage