|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.memory.structure.PartiallyStoredVector<E>
public final class PartiallyStoredVector<E>
A class implementing a vector with two kind of storage: standard static storage in an array, and backtrackable storage. By convention, objects with small indices (0 .. 999999) are statically managed as if they were in a standard array. And objects with large indices (1000000 ... ) are "stored" in a backtrackable manner, as if they were in a StoredIntVector
Constructor Summary | |
---|---|
PartiallyStoredVector(IEnvironment env)
Constructor |
Method Summary | |
---|---|
int |
add(E o)
Add an stored object |
void |
clear()
Clear datastructures for safe reuses |
boolean |
contains(Object o)
Check wether an object is stored. |
E |
get(int index)
Get the index th stored object |
static int |
getFirstStaticIndex()
Return the indice of the first static object |
static int |
getGlobalIndex(int idx,
boolean isStatic)
|
DisposableIntIterator |
getIndexIterator()
|
DisposableIterator |
getIterator()
|
int |
getLastStaticIndex()
Return the indice of the last static object |
int |
getLastStoredIndex()
Return the indice of the last stored object |
static int |
getSmallIndex(int idx)
Return the indexe of an object minus the stored offset |
int |
insert(int ind,
E o)
Insert an stored object |
boolean |
isEmpty()
Check wether the structure is empty |
static boolean |
isStaticIndex(int idx)
Check wether the indice idx define a static object |
int |
remove(Object o)
Remove an object |
int |
size()
Return the number of static and stored objects contained in the structure |
int |
staticAdd(E o)
Add a object in the array of static object |
int |
staticInsert(int ind,
E o)
Insert an object in the array of static object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PartiallyStoredVector(IEnvironment env)
env
- environment where the data structure should be createdMethod Detail |
---|
public void clear()
public boolean contains(Object o)
o
- the object to look for
public int staticAdd(E o)
o
- the object to add
public int staticInsert(int ind, E o)
ind
- indice to insert ino
- object to insert
public int remove(Object o)
o
- object to remove
MemoryException
- when trying to remove unknown object or stored objectpublic int add(E o)
o
- the object to add
public int insert(int ind, E o)
ind
- indice where to add objecto
- object to insert
public E get(int index)
index
- the indice of the required object
public boolean isEmpty()
public int size()
public DisposableIntIterator getIndexIterator()
public DisposableIterator getIterator()
public static boolean isStaticIndex(int idx)
idx
-
public static int getSmallIndex(int idx)
idx
-
public static int getGlobalIndex(int idx, boolean isStatic)
public int getLastStaticIndex()
public static int getFirstStaticIndex()
public int getLastStoredIndex()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |