|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.memory.trailing.StoredDoubleVector
public final class StoredDoubleVector
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 |
protected StoredDoubleVectorTrail |
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.IStateDoubleVector |
---|
LOGGER |
Constructor Summary | |
---|---|
StoredDoubleVector(EnvironmentTrailing env)
Constructs an empty stored search vector. |
|
StoredDoubleVector(EnvironmentTrailing env,
double[] entries)
|
|
StoredDoubleVector(EnvironmentTrailing env,
int initialSize,
double initialValue)
Constructs a stored search vector with an initial size, and initial values. |
Method Summary | |
---|---|
double |
_set(int index,
double val,
int stamp)
Sets an element without storing the previous value. |
void |
add(double 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. |
double |
get(int index)
Returns the index th element of the vector. |
DisposableIntIterator |
getIterator()
|
boolean |
isEmpty()
Checks if the vector is empty. |
double |
quickGet(int index)
return the indexth element of the vector without an bound check. |
double |
quickSet(int index,
double val)
Unsafe setter => don't do bound verification |
void |
remove(int i)
Removes an int. |
void |
removeLast()
removes the search at the end of the vector. |
double |
set(int index,
double 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
public int[] worldStamps
protected final StoredDoubleVectorTrail myTrail
Constructor Detail |
---|
public StoredDoubleVector(EnvironmentTrailing env, int initialSize, double initialValue)
env
- The current environment.initialSize
- The initial size.initialValue
- The initial common value.public StoredDoubleVector(EnvironmentTrailing env, double[] entries)
public StoredDoubleVector(EnvironmentTrailing env)
env
- The current environment.Method Detail |
---|
public int size()
size
in interface IStateDoubleVector
public boolean isEmpty()
isEmpty
in interface IStateDoubleVector
public void ensureCapacity(int minCapacity)
minCapacity
- the necessary capacity.public void add(double i)
add
in interface IStateDoubleVector
i
- The search to add.public void remove(int i)
remove
in interface IStateDoubleVector
i
- The search to remove.public void removeLast()
removeLast
in interface IStateDoubleVector
public double get(int index)
index
th element of the vector.
get
in interface IStateDoubleVector
public double quickGet(int index)
IStateDoubleVector
quickGet
in interface IStateDoubleVector
index
- index
public double set(int index, double val)
val
to the element index
.
set
in interface IStateDoubleVector
public double quickSet(int index, double val)
IStateDoubleVector
quickSet
in interface IStateDoubleVector
index
- the index of the replaced valueval
- the new value
public double _set(int index, double val, int stamp)
index
- Index where to setval
- value to be changedstamp
- world when the modification is done
public DisposableIntIterator getIterator()
getIterator
in interface IStateDoubleVector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |