|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchoco.mem.StoredIntVector
public final class StoredIntVector
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 | |
|---|---|
StoredIntVector(Environment env)
Constructs an empty stored search vector. |
|
StoredIntVector(Environment env,
int initialSize,
int initialValue)
Constructs a stored search vector with an initial size, and initial values. |
|
StoredIntVector(int[] entries)
|
|
| Method Summary | |
|---|---|
void |
add(int 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. |
int |
get(int index)
Returns the indexth element of the vector. |
boolean |
isEmpty()
Checks if the vector is empty. |
void |
removeLast()
removes the search at the end of the vector. |
int |
set(int index,
int 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 StoredIntVector(Environment env,
int initialSize,
int initialValue)
env - The current environment.initialSize - The initial size.initialValue - The initial common value.public StoredIntVector(int[] entries)
public StoredIntVector(Environment env)
env - The current environment.| Method Detail |
|---|
public int size()
size in interface IStateIntVectorpublic boolean isEmpty()
isEmpty in interface IStateIntVectorpublic void ensureCapacity(int minCapacity)
minCapacity - the necessary capacity.public void add(int i)
add in interface IStateIntVectori - The search to add.public void removeLast()
removeLast in interface IStateIntVectorpublic int get(int index)
indexth element of the vector.
get in interface IStateIntVector
public int set(int index,
int val)
val to the element index.
set in interface IStateIntVector
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||