|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.util.StoredPointerCycle
public class StoredPointerCycle
A data structure implementing a subset of a given set, by means of a cyclic chain of pointers (grossly specking, each entry contains the index of the next entry in the cycle). This data structure is convenient for iterating a subset of objets (chain of pointers), starting from any object (cyclic iteration). The data structure is based on backtrackable vectors (@link{StoredIntVector}) It is also robust in the sense that objects can be removed from the cycle while the cycle is being iterated
Field Summary | |
---|---|
static int |
INVALID_INDEX
wildcard: all entries of the vector contain valid indices (i.e. values from 0 to n-1, n being the vector size) or the constant INVALID_INDEX |
protected static java.util.logging.Logger |
logger
Reference to the root Logger, an object for logging trace statements related to propagation events (using the java.util.logging package) |
protected StoredIntVector |
next
The vectors of entries |
Constructor Summary | |
---|---|
StoredPointerCycle(Environment env)
|
Method Summary | |
---|---|
void |
add(int idx,
boolean inCycle)
Adds an entry to the static collection, at a given index |
IntIterator |
getCycleButIterator(int avoidIndex)
|
boolean |
isInCycle(int idx)
Tests if a given index is in the cycle or not |
void |
setInCycle(int i)
Sets the index into the cycle |
void |
setOutOfCycle(int i)
Sets the index into the cycle |
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int INVALID_INDEX
protected StoredIntVector next
protected static java.util.logging.Logger logger
Constructor Detail |
---|
public StoredPointerCycle(Environment env)
Method Detail |
---|
public int size()
public boolean isInCycle(int idx)
public void add(int idx, boolean inCycle)
inCycle
- Specifies if the new entry is in the cyclepublic void setInCycle(int i)
public void setOutOfCycle(int i)
public IntIterator getCycleButIterator(int avoidIndex)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |