|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.memory.trailing.StoredVector<E>
public final class StoredVector<E>
Implements a backtrackable search vector.
Field Summary | |
---|---|
protected StoredVectorTrail |
myTrail
|
int[] |
worldStamps
Contains time stamps for all entries (the world index of the last update for each entry) |
Fields inherited from interface choco.kernel.memory.IStateVector |
---|
MIN_CAPACITY |
Constructor Summary | |
---|---|
StoredVector(EnvironmentTrailing env)
Constructs a stored search vector with an initial size, and initial values. |
|
StoredVector(int[] entries)
|
Method Summary | |
---|---|
E |
_set(int index,
Object val,
int stamp)
Sets an element without storing the previous value. |
boolean |
add(E i)
Adds a new search at the end of the vector. |
void |
ensureCapacity(int minCapacity)
Checks if the capacity is great enough, else the capacity is extended. |
E |
get(int index)
Returns the index th element of the vector. |
boolean |
isEmpty()
Checks if the vector is empty. |
void |
removeLast()
removes the search at the end of the vector. |
E |
set(int index,
E val)
Assigns a new value val to the element index . |
int |
size()
Returns the current size of the stored search vector. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int[] worldStamps
protected final StoredVectorTrail myTrail
Constructor Detail |
---|
public StoredVector(EnvironmentTrailing env)
env
- The current environment.public StoredVector(int[] entries)
Method Detail |
---|
public int size()
IStateVector
size
in interface IStateVector<E>
public boolean isEmpty()
IStateVector
isEmpty
in interface IStateVector<E>
public void ensureCapacity(int minCapacity)
IStateVector
ensureCapacity
in interface IStateVector<E>
minCapacity
- the necessary capacity.public boolean add(E i)
IStateVector
add
in interface IStateVector<E>
i
- The search to add.public void removeLast()
IStateVector
removeLast
in interface IStateVector<E>
public E get(int index)
IStateVector
index
th element of the vector.
get
in interface IStateVector<E>
public E set(int index, E val)
IStateVector
val
to the element index
.
set
in interface IStateVector<E>
public E _set(int index, Object val, int stamp)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |