public class IndexedBipartiteSet extends IStateIntVector
Modifier and Type | Field and Description |
---|---|
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.
|
elementData, environment, MIN_CAPACITY, size
Constructor and Description |
---|
IndexedBipartiteSet(IEnvironment environment,
int nbValues)
Create a stored bipartite set with a size.
|
IndexedBipartiteSet(IEnvironment environment,
int[] values) |
Modifier and Type | Method and Description |
---|---|
void |
add(int i)
Adds a new search at the end of the vector.
|
void |
buildList(IEnvironment environment,
int[] values) |
void |
clear() |
boolean |
contains(int object) |
int |
findIndexOfInt(int a) |
int |
get(int index)
Returns the
index th element of the vector. |
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(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.
|
deepCopy, rangeCheck
protected int[] list
protected int[] position
protected IStateInt last
public IndexedBipartiteSet(IEnvironment environment, int nbValues)
environment
- backtrable environmentnbValues
- capacitypublic IndexedBipartiteSet(IEnvironment environment, int[] values)
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 class IStateIntVector
public final boolean isEmpty()
IStateIntVector
isEmpty
in class IStateIntVector
public final void add(int i)
IStateIntVector
add
in class IStateIntVector
i
- The search to add.public final void clear()
public final void removeLast()
IStateIntVector
removeLast
in class IStateIntVector
public void remove(int object)
IStateIntVector
remove
in class IStateIntVector
object
- The search to remove.public boolean contains(int object)
contains
in class IStateIntVector
public final int get(int index)
IStateIntVector
index
th element of the vector.get
in class IStateIntVector
public final int quickGet(int index)
IStateIntVector
quickGet
in class IStateIntVector
index
- index of the elementpublic final int set(int index, int val)
IStateIntVector
val
to the element index
and returns
the old valueset
in class IStateIntVector
public final int quickSet(int index, int val)
IStateIntVector
quickSet
in class IStateIntVector
index
- the index where the value is modifiedval
- the new valuepublic final String pretty()
public final int findIndexOfInt(int a)
Copyright © 2015. All rights reserved.