public interface IntDomain
IntVar implementation.
A domain is like a set of integers.| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(int v)
Checks if the specified value belongs to the domain.
|
int |
fillArray(int[] dest)
Copies the values of the domain into an array.
|
boolean |
isBound()
Checks if the domain contains a single element.
|
int |
max()
Returns the maximum value of the domain.
|
int |
min()
Returns the minimum value of the domain.
|
void |
remove(int v,
DomainListener l)
Removes a value from the domain and notifies appropriately the listener.
|
void |
removeAbove(int v,
DomainListener l)
Removes every value larger than the specified value from the domain.
|
void |
removeAllBut(int v,
DomainListener l)
Removes every value from the domain except the specified one.
|
void |
removeBelow(int v,
DomainListener l)
Removes every value less than the specified value from the domain.
|
int |
size()
Returns the cardinality of the domain.
|
String |
toString() |
int min()
int max()
int size()
boolean contains(int v)
v - the value to be testedboolean isBound()
void remove(int v,
DomainListener l)
v - the value to be removedl - the methods of the listener are notified as follows:
DomainListener.change() is called
if v belongs to the domainDomainListener.changeMax() is called
if v is equal to the maximum valueDomainListener.changeMin() is called
if v is equal to the minimum valueDomainListener.bind() is called
if v belongs to the domain and after its removal
the domain has a single valueDomainListener.empty() is called
if v is the last value in the domain i.e.
the domain is empty after this operationvoid removeAllBut(int v,
DomainListener l)
v - the value to be keptl - the methods of the listener are notified as follows:
DomainListener.change() is called
if some value is removed during the operationDomainListener.changeMax() is called
if v is not equal to the maximum valueDomainListener.changeMin() is called
if v is not equal to the minimum valueDomainListener.bind() is called
if v belongs to the domain and after its removal
the domain has a single valueDomainListener.empty() is called
if v is not in the domain i.e.
the domain is empty after this operationvoid removeBelow(int v,
DomainListener l)
v - the value such that all the values less than v are removedl - the methods of the listener are notified as follows:
DomainListener.change() is called
if some value is removed during the operationDomainListener.changeMax() is called
if v is is larger than the minimum valueDomainListener.bind() is called
if v is equal to the maximum valueDomainListener.empty() is called
if v is larger than the maximum value i.e.
the domain is empty after this operationvoid removeAbove(int v,
DomainListener l)
v - the value such that all the values larger than v are removedl - the methods of the listener are notified as follows:
DomainListener.change() is called
if some value is removed during the operationDomainListener.changeMax() is called
if v is is less than the maximum valueDomainListener.bind() is called
if v is equal to the minimum valueDomainListener.empty() is called
if v is less than the minimum value i.e.
the domain is empty after this operationint fillArray(int[] dest)
dest - an array large enough dest.length >= size()dest[0,...,size-1] contains
the values in the domain in an arbitrary orderCopyright © 2018 Laurent Michel, Pierre Schaus, Pascal Van Hentenryck. All rights reserved.