|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.memory.structure.StoredIndexedBipartiteSet
public class StoredIndexedBipartiteSet
A stored list dedicated to positive integers and three operations : - iteration - removal of an element - check if an element is or not within the list It only requires a StoredInt to denote the first element of the list and proceeds by swapping element with the first one to remove them and incrementing the index of the first element. IT DOES NOT PRESERVE THE ORDER OF THE LIST
Field Summary | |
---|---|
protected BipartiteSetIterator |
_iterator
|
protected IStateInt |
last
The first element of the list |
protected int[] |
list
The list of values |
protected int[] |
position
The position of each element within the list. |
Fields inherited from interface choco.kernel.memory.IStateIntVector |
---|
LOGGER, MIN_CAPACITY |
Constructor Summary | |
---|---|
StoredIndexedBipartiteSet(IEnvironment environment,
ArrayList<IndexedObject> values)
|
|
StoredIndexedBipartiteSet(IEnvironment environment,
IndexedObject[] values)
|
|
StoredIndexedBipartiteSet(IEnvironment environment,
int nbValues)
Create a stored bipartite set with a size. |
|
StoredIndexedBipartiteSet(IEnvironment environment,
int[] values)
|
Method Summary | |
---|---|
int[] |
_getStructure()
DO NOT USE : FOR MEMORY OPTIM ONLY |
void |
add(int i)
Adds a new search at the end of the vector. |
void |
buildList(IEnvironment environment,
int[] values)
|
void |
clear()
|
boolean |
contain(IndexedObject object)
|
boolean |
contain(int object)
|
int |
findIndexOfInt(int a)
|
int |
get(int index)
Returns the index th element of the vector. |
DisposableIntIterator |
getIterator()
|
IndexedObject |
getObject(int index)
|
BipartiteSetIterator |
getObjectIterator()
|
void |
increaseSize(int gap)
Increase the number of value watched. |
boolean |
isEmpty()
Checks if the vector is empty. |
String |
pretty()
|
int |
quickGet(int index)
access an element without any bound check |
int |
quickSet(int index,
int val)
Assigns a new value val to the element indexth and return the old value without bound check |
void |
remove(IndexedObject object)
|
void |
remove(int object)
Removes an int. |
void |
removeLast()
removes the search at the end of the vector. |
int |
set(int index,
int val)
Assigns a new value val to the element index and returns
the old value |
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 |
---|
protected int[] list
protected int[] position
protected IStateInt last
protected BipartiteSetIterator _iterator
Constructor Detail |
---|
public StoredIndexedBipartiteSet(IEnvironment environment, int[] values)
environment
- values:
- a set of DIFFERENT positive integer values !public StoredIndexedBipartiteSet(IEnvironment environment, IndexedObject[] values)
environment
- values:
- a set of IndexObjects which have different indexes !public StoredIndexedBipartiteSet(IEnvironment environment, ArrayList<IndexedObject> values)
environment
- values:
- a set of IndexObjects which have different indexes !public StoredIndexedBipartiteSet(IEnvironment environment, int nbValues)
environment
- nbValues
- Method Detail |
---|
public void buildList(IEnvironment environment, int[] values)
public final void increaseSize(int gap)
gap
- the gap the reach the expected sizepublic final int size()
IStateIntVector
size
in interface IStateIntVector
public final boolean isEmpty()
IStateIntVector
isEmpty
in interface IStateIntVector
public final void add(int i)
IStateIntVector
add
in interface IStateIntVector
i
- The search to add.public final void clear()
public final void removeLast()
IStateIntVector
removeLast
in interface IStateIntVector
public void remove(int object)
IStateIntVector
remove
in interface IStateIntVector
object
- The search to remove.public final void remove(IndexedObject object)
public boolean contain(int object)
contain
in interface IStateIntVector
public final boolean contain(IndexedObject object)
public final int get(int index)
IStateIntVector
index
th element of the vector.
get
in interface IStateIntVector
public final int quickGet(int index)
IStateIntVector
quickGet
in interface IStateIntVector
public final IndexedObject getObject(int index)
public final int set(int index, int val)
IStateIntVector
val
to the element index
and returns
the old value
set
in interface IStateIntVector
public final int quickSet(int index, int val)
IStateIntVector
quickSet
in interface IStateIntVector
index
- the index where the value is modifiedval
- the new value
public final DisposableIntIterator getIterator()
getIterator
in interface IStateIntVector
public final BipartiteSetIterator getObjectIterator()
public final String pretty()
public final int findIndexOfInt(int a)
public final int[] _getStructure()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |