choco.mem
Class PartiallyStoredIntVector

java.lang.Object
  extended by 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


Field Summary
static int INITIAL_STATIC_CAPACITY
           
static int INITIAL_STORED_CAPACITY
           
protected  int nStaticInts
           
protected  IStateInt nStoredInts
           
protected  int[] staticInts
           
static int STORED_OFFSET
           
protected  int[] storedInts
           
 
Constructor Summary
PartiallyStoredIntVector(Environment env)
           
 
Method Summary
 int add(int o)
           
 void ensureStaticCapacity(int n)
           
 void ensureStoredCapacity(int n)
           
 int get(int index)
           
static int getGlobalIndex(int idx, boolean isStatic)
           
 IntIterator getIndexIterator()
           
static int getSmallIndex(int idx)
           
 boolean isEmpty()
           
static boolean isStaticIndex(int idx)
           
 int size()
           
 int staticAdd(int o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

PartiallyStoredIntVector

public PartiallyStoredIntVector(Environment env)
Method Detail

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)