choco.mem
Class StoredFloatTrail

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

public class StoredFloatTrail
extends java.lang.Object
implements ITrailStorage

A backtrackable float variable trail storing past values of all the float variables.


Constructor Summary
StoredFloatTrail(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(StoredFloat v, double 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

StoredFloatTrail

public StoredFloatTrail(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(StoredFloat v,
                              double 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