|
|||||||||
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
Deprecated. 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
Deprecated. Reference to the root Logger, an object for logging trace statements related to propagation events (using the java.util.logging package). |
protected StoredIntVector |
next
Deprecated. The vectors of entries. |
Constructor Summary | |
---|---|
StoredPointerCycle(Environment env)
Deprecated. Builds the data structure with the specified environment. |
Method Summary | |
---|---|
void |
add(int idx,
boolean inCycle)
Deprecated. Adds an entry to the static collection, at a given index. |
IntIterator |
getCycleButIterator(int avoidIndex)
Deprecated. Builds an iterator to enumerate all indices except one. |
boolean |
isInCycle(int idx)
Deprecated. Tests if a given index is in the cycle or not. |
void |
setInCycle(int i)
Deprecated. Sets the index into the cycle. |
void |
setOutOfCycle(int i)
Deprecated. Sets the index into the cycle. |
int |
size()
Deprecated. Compute the size of the data structure. |
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)
env
- The environment responsible of managing worldsMethod Detail |
---|
public int size()
public boolean isInCycle(int idx)
idx
- The index to be checked
public void add(int idx, boolean inCycle)
idx
- where the entry should be addedinCycle
- Specifies if the new entry is in the cyclepublic void setInCycle(int i)
i
- the index to addpublic void setOutOfCycle(int i)
i
- removes an index from the cyclepublic IntIterator getCycleButIterator(int avoidIndex)
avoidIndex
- the index to exclude
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |