|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectJaCoP.core.SimpleBacktrackableManager
public class SimpleBacktrackableManager
It is responsible of remembering what variables have changed at given store level.
| Field Summary | |
|---|---|
int |
currentLevel
It specifies the current level which is active in the manager. |
boolean |
currentLevelMax
It specifies if for the current level we have reached the cutoff value. |
Backtrackable[] |
objects
It stores objects which change has to be restored upon backtracking. |
boolean |
trailContainsAllChanges
It specifies if for the current level the all changes are already stored in the trail. |
| Constructor Summary | |
|---|---|
SimpleBacktrackableManager(Backtrackable[] vars,
int noOfObjects)
It constructs a trail manager. |
|
| Method Summary | |
|---|---|
void |
addChanged(int index)
It allows to inform the manager that a given item with id (index) has changed at given level. |
int |
getLevel()
It returns the current level at which the changes are being registered. |
boolean |
isRecognizedAsChanged(int index)
It allows for easy testing if a given object is considered by the manager as the object which has changed and needs being informed about backtracking. |
void |
removeLevel(int removedLevel)
It allows to inform all objects which have changed at removedLevel that the backtracking from that level has occurred. |
void |
setLevel(int level)
It specifies the level which should become the active one in the manager. |
void |
setSize(int size)
It specifies how many objects within objects array are being actually managed. |
java.lang.String |
toString()
|
void |
update(Backtrackable[] objects,
int noOfObjects)
It updates the manager with new array of objects to manage and new number of them. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int currentLevel
public Backtrackable[] objects
public boolean trailContainsAllChanges
public boolean currentLevelMax
| Constructor Detail |
|---|
public SimpleBacktrackableManager(Backtrackable[] vars,
int noOfObjects)
noOfObjects - it specifies number of objects being managed.vars - it specifies the list of objects being managed.| Method Detail |
|---|
public void addChanged(int index)
addChanged in interface BacktrackableManagerindex - it specifies the index of the object which has changed.public void setLevel(int level)
setLevel in interface BacktrackableManagerlevel - the active level at which the changes will be recorded.public void removeLevel(int removedLevel)
removeLevel in interface BacktrackableManagerremovedLevel - it specifies the level which is being removed.public void setSize(int size)
setSize in interface BacktrackableManagersize - the number of objects in the array.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isRecognizedAsChanged(int index)
isRecognizedAsChanged in interface BacktrackableManagerindex - the position of the object which status is in question.
public int getLevel()
BacktrackableManager
getLevel in interface BacktrackableManager
public void update(Backtrackable[] objects,
int noOfObjects)
BacktrackableManager
update in interface BacktrackableManagerobjects - a new array of objectsnoOfObjects - number of objects in the new array to be taken care of.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||