choco.mem
Class PartiallyStoredIntVector
java.lang.Object
choco.mem.PartiallyStoredIntVector
public class PartiallyStoredIntVector
- extends java.lang.Object
A class implementing a vector with two kind of storage:
standard static storage in an array, and backtrackable storage.
By convention, integers with small indices (0 .. 999999) are statically managed
as if they were in a standard array.
And integers with large indices (1000000 ... ) are "stored" in a backtrackable
manner, as if they were in a StoredIntVector
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INITIAL_STATIC_CAPACITY
public static final int INITIAL_STATIC_CAPACITY
- See Also:
- Constant Field Values
INITIAL_STORED_CAPACITY
public static final int INITIAL_STORED_CAPACITY
- See Also:
- Constant Field Values
STORED_OFFSET
public static final int STORED_OFFSET
- See Also:
- Constant Field Values
staticInts
protected int[] staticInts
storedInts
protected int[] storedInts
nStaticInts
protected int nStaticInts
nStoredInts
protected IStateInt nStoredInts
PartiallyStoredIntVector
public PartiallyStoredIntVector(Environment env)
staticAdd
public int staticAdd(int o)
ensureStaticCapacity
public void ensureStaticCapacity(int n)
add
public int add(int o)
ensureStoredCapacity
public void ensureStoredCapacity(int n)
get
public int get(int index)
isEmpty
public boolean isEmpty()
size
public int size()
getIndexIterator
public IntIterator getIndexIterator()
isStaticIndex
public static boolean isStaticIndex(int idx)
getSmallIndex
public static int getSmallIndex(int idx)
getGlobalIndex
public static int getGlobalIndex(int idx,
boolean isStatic)