- java.lang.Object
-
- org.chocosolver.memory.IStateIntVector
-
- Direct Known Subclasses:
StoredIntVector
public abstract class IStateIntVector extends Object
Describes an search vector with states (describing some history of the data structure).
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]
elementData
Contains the elements of the vector.protected IEnvironment
environment
The current environment.static int
MIN_CAPACITY
Minimal capacity of a vectorprotected IStateInt
size
A backtrackable search with the size of the vector.
-
Constructor Summary
Constructors Constructor Description IStateIntVector(IEnvironment env, int[] entries)
IStateIntVector(IEnvironment env, int initialSize, int initialValue)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
add(int i)
Adds a new search at the end of the vector.int
quickGet(int index)
access an element without any bound checkabstract int
quickSet(int index, int val)
Assigns a new value val to the element indexth and return the old value without bound checkprotected boolean
rangeCheck(int index)
abstract int
set(int index, int val)
Assigns a new valueval
to the elementindex
and returns the old value
-
-
-
Field Detail
-
MIN_CAPACITY
public static final int MIN_CAPACITY
Minimal capacity of a vector- See Also:
- Constant Field Values
-
elementData
protected int[] elementData
Contains the elements of the vector.
-
size
protected IStateInt size
A backtrackable search with the size of the vector.
-
environment
protected final IEnvironment environment
The current environment.
-
-
Constructor Detail
-
IStateIntVector
public IStateIntVector(IEnvironment env, int initialSize, int initialValue)
-
IStateIntVector
public IStateIntVector(IEnvironment env, int[] entries)
-
-
Method Detail
-
rangeCheck
protected boolean rangeCheck(int index)
-
add
public abstract void add(int i)
Adds a new search at the end of the vector.- Parameters:
i
- The search to add.
-
quickGet
public int quickGet(int index)
access an element without any bound check- Parameters:
index
- index of the element- Returns:
- the value
-
set
public abstract int set(int index, int val)
Assigns a new valueval
to the elementindex
and returns the old value
-
quickSet
public abstract int quickSet(int index, int val)
Assigns a new value val to the element indexth and return the old value without bound check- Parameters:
index
- the index where the value is modifiedval
- the new value- Returns:
- the old value
-
-