public class StoredIndexedBipartiteSet extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
StoredIndexedBipartiteSet.BipartiteSetIterator |
Modifier and Type | Field and Description |
---|---|
protected StoredIndexedBipartiteSet.BipartiteSetIterator |
_cachedIterator |
protected IndexedObject[] |
idxToObjects
If objects are added to the list, a mapping from their
indexes is needed.
|
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.
|
Constructor and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
int[] |
_getStructure()
DO NOT USE : FOR MEMORY OPTIM ONLY
|
void |
add(int i) |
void |
buildList(IEnvironment environment,
int[] values) |
void |
clear() |
boolean |
contains(IndexedObject object) |
boolean |
contains(int object) |
StoredIndexedBipartiteSet |
duplicate(Solver solver) |
int |
findIndexOfInt(int a) |
int |
get(int index) |
DisposableIntIterator |
getIterator() |
IndexedObject |
getObject(int index) |
void |
increaseSize(int gap)
Increase the number of value watched.
|
boolean |
isEmpty() |
String |
pretty() |
void |
remove(IndexedObject object) |
void |
remove(int object) |
void |
removeLast() |
int |
set(int index,
int val) |
int |
size() |
protected int[] list
protected int[] position
protected IndexedObject[] idxToObjects
protected IStateInt last
protected StoredIndexedBipartiteSet.BipartiteSetIterator _cachedIterator
public StoredIndexedBipartiteSet(IEnvironment environment, int[] values)
environment
- the environmentvalues:
- a set of DIFFERENT positive integer values !public StoredIndexedBipartiteSet(IEnvironment environment, IndexedObject[] values)
environment
- the environmentvalues:
- a set of IndexObjects which have different indexes !public StoredIndexedBipartiteSet(IEnvironment environment, ArrayList<IndexedObject> values)
environment
- the environmentvalues:
- a set of IndexObjects which have different indexes !public StoredIndexedBipartiteSet(IEnvironment environment, int nbValues)
environment
- the environmentnbValues
- nb valuespublic void buildList(IEnvironment environment, int[] values)
public final void increaseSize(int gap)
gap
- the gap the reach the expected sizepublic final int size()
public final boolean isEmpty()
public final void add(int i)
public final void clear()
public final void removeLast()
public void remove(int object)
public final void remove(IndexedObject object)
public boolean contains(int object)
public final boolean contains(IndexedObject object)
public final int get(int index)
public final IndexedObject getObject(int index)
public final int set(int index, int val)
public final DisposableIntIterator getIterator()
public final String pretty()
public final int findIndexOfInt(int a)
public final int[] _getStructure()
public StoredIndexedBipartiteSet duplicate(Solver solver)
Copyright © 2015. All rights reserved.