|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.AbstractEntity
choco.set.var.BitSetEnumeratedDomain
public class BitSetEnumeratedDomain
Created by IntelliJ IDEA. User: Hadrien Date: 6 juin 2004 Time: 14:45:44 To change this template use File | Settings | File Templates.
Nested Class Summary | |
---|---|
protected class |
BitSetEnumeratedDomain.DeltaDomainIterator
|
Field Summary | |
---|---|
protected int[] |
chain
A chained list implementing two subsets of values: - the removed values waiting to be propagated - the removed values being propagated (each element points to the index of the enxt element) -1 for the last element |
protected StoredBitSet |
contents
A bit set indicating for each value whether it is present or not |
protected int |
firstIndexBeingPropagated
start of the chain for the values being propagated -1 for empty chains |
protected int |
firstIndexToBePropagated
start of the chain for the values waiting to be propagated -1 for empty chains |
protected static java.util.logging.Logger |
logger
|
protected int |
offset
The offset, that is the minimal value of the domain (stored at index 0). |
protected StoredInt |
size
Number of present values. |
Fields inherited from class choco.AbstractEntity |
---|
hook, problem |
Constructor Summary | |
---|---|
BitSetEnumeratedDomain(SetVar v,
int a,
int b,
boolean full)
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. |
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 |
IntIterator |
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. |
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 choco.AbstractEntity |
---|
getProblem, pretty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.util.logging.Logger logger
protected final int offset
protected StoredInt size
protected StoredBitSet contents
protected int[] chain
protected int firstIndexToBePropagated
protected int firstIndexBeingPropagated
Constructor Detail |
---|
public BitSetEnumeratedDomain(SetVar v, int a, int b, boolean full)
v
- The involved variable.a
- Minimal value.b
- Maximal value.full
- indicate if the initial bitSetDomain is full or empty (env or ker)Method Detail |
---|
public int getFirstVal()
public int getLastVal()
public boolean contains(int x)
x
- The value to check.public boolean remove(int x)
public boolean add(int x)
public int getSize()
public int getNextValue(int x)
x
if non exist return -1
public int getPrevValue(int x)
x
if non exist return -1
public boolean hasNextValue(int x)
public boolean hasPrevValue(int x)
public IntIterator getDeltaIterator()
public void freezeDeltaDomain()
public boolean releaseDeltaDomain()
public boolean getReleasedDeltaDomain()
public void clearDeltaDomain()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |