|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.mem.StoredVector
public final class StoredVector
Implements a backtrackable search vector.
Cette classe permet de stocker facilment des entiers dans un tableau backtrackable d'entiers.
Field Summary | |
---|---|
static int |
MIN_CAPACITY
Minimal capacity of a vector |
Constructor Summary | |
---|---|
StoredVector(Environment env)
Constructs a stored search vector with an initial size, and initial values. |
|
StoredVector(int[] entries)
|
Method Summary | |
---|---|
boolean |
add(java.lang.Object 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. |
java.lang.Object |
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. |
java.lang.Object |
set(int index,
java.lang.Object 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 static final int MIN_CAPACITY
Constructor Detail |
---|
public StoredVector(Environment env)
env
- The current environment.public StoredVector(int[] entries)
Method Detail |
---|
public int size()
public boolean isEmpty()
public void ensureCapacity(int minCapacity)
minCapacity
- the necessary capacity.public boolean add(java.lang.Object i)
i
- The search to add.public void removeLast()
public java.lang.Object get(int index)
index
th element of the vector.
public java.lang.Object set(int index, java.lang.Object val)
val
to the element index
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |