|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.cp.solver.variables.set.BitSetEnumeratedDomain
public class BitSetEnumeratedDomain
Field Summary | |
---|---|
protected IStateBitSet |
contents
A bit set indicating for each value whether it is present or not |
protected int |
offset
The offset, that is the minimal value of the domain (stored at index 0). |
protected IStateInt |
size
Number of present values. |
Fields inherited from interface choco.kernel.solver.variables.set.SetSubDomain |
---|
LOGGER |
Constructor Summary | |
---|---|
BitSetEnumeratedDomain(SetVar v,
int[] sortedValues,
boolean full,
IEnvironment environment)
|
|
BitSetEnumeratedDomain(SetVar v,
int a,
int b,
boolean full,
IEnvironment environment)
Constructs a new domain for the specified variable and bounds. |
Method Summary | |
---|---|
boolean |
add(int x)
add a value. |
void |
clearDeltaDomain()
cleans the data structure implementing the delta domain |
boolean |
contains(int x)
Checks if the value is present. |
IDeltaDomain |
copyDelta()
|
static BitSetEnumeratedDomain |
empty(SetVar v,
IEnvironment environment)
Specific constructor for empty set variable |
void |
freezeDeltaDomain()
The delta domain container is "frozen" (it can no longer accept new value removals) so that this set of values can be iterated as such |
DisposableIntIterator |
getDeltaIterator()
|
int |
getFirstVal()
Returns the minimal present value. |
int |
getLastVal()
Returns the maximal present value. |
int |
getNextValue(int x)
Returns the value following x
if non exist return -1 |
int |
getPrevValue(int x)
Returns the value preceding x
if non exist return -1 |
boolean |
getReleasedDeltaDomain()
|
int |
getSize()
Returns the current size of the domain. |
boolean |
hasNextValue(int x)
Checks if the value has a following value. |
boolean |
hasPrevValue(int x)
Checks if the value has a preceding value. |
String |
pretty()
pretty printing of the object. |
boolean |
releaseDeltaDomain()
after an iteration over the delta domain, the delta domain is reopened again. |
boolean |
remove(int x)
Removes a value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final int offset
protected IStateInt size
protected IStateBitSet contents
Constructor Detail |
---|
public BitSetEnumeratedDomain(SetVar v, int a, int b, boolean full, IEnvironment environment)
v
- The involved variable.a
- Minimal value.b
- Maximal value.full
- indicate if the initial bitSetDomain is full or empty (env or ker)environment
- public BitSetEnumeratedDomain(SetVar v, int[] sortedValues, boolean full, IEnvironment environment)
Method Detail |
---|
public static BitSetEnumeratedDomain empty(SetVar v, IEnvironment environment)
v
- the set variable with no valueenvironment
-
public int getFirstVal()
getFirstVal
in interface SetSubDomain
public int getLastVal()
getLastVal
in interface SetSubDomain
public boolean contains(int x)
contains
in interface SetSubDomain
x
- The value to check.public boolean remove(int x)
remove
in interface SetSubDomain
public boolean add(int x)
x
- value to add
public int getSize()
getSize
in interface SetSubDomain
public int getNextValue(int x)
x
if non exist return -1
getNextValue
in interface SetSubDomain
x
- starting value
public int getPrevValue(int x)
x
if non exist return -1
x
- starting value
public boolean hasNextValue(int x)
x
- starting value
public boolean hasPrevValue(int x)
x
- starting value
public DisposableIntIterator getDeltaIterator()
getDeltaIterator
in interface SetSubDomain
public IDeltaDomain copyDelta()
copyDelta
in interface SetSubDomain
public void freezeDeltaDomain()
freezeDeltaDomain
in interface SetSubDomain
public boolean releaseDeltaDomain()
releaseDeltaDomain
in interface SetSubDomain
public boolean getReleasedDeltaDomain()
getReleasedDeltaDomain
in interface SetSubDomain
public void clearDeltaDomain()
clearDeltaDomain
in interface SetSubDomain
public String pretty()
pretty
in interface IPretty
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |