|
Cream version 1.4 Core API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjp.ac.kobe_u.cs.cream.Domain
jp.ac.kobe_u.cs.cream.IntDomain
public class IntDomain
IntDomain class represents domains on integers. Integer domain is implemented as a list of intervals.
IntVariable
Field Summary | |
---|---|
static IntDomain |
EMPTY
Empty integer domain |
static IntDomain |
FULL
Full integer domain MIN_VALUE..MAX_VALUE. |
static int |
MAX_VALUE
Maximum integer value (231-1) |
static int |
MIN_VALUE
Minimum integer value (-231+1) |
Constructor Summary | |
---|---|
IntDomain()
Constructs the empty integer domain. |
|
IntDomain(int value)
Constructs a singleton integer domain. |
|
IntDomain(int min,
int max)
Constructs an integer domain of min..max. |
Method Summary | |
---|---|
Domain |
cap(Domain d)
Returns a new domain of the intersection (optional operation). |
IntDomain |
capInterval(int lo,
int hi)
Returns a new domain which is the intersection of the curren domain and the interval lo..hi. |
Object |
clone()
Returns true when the domain is empty. |
boolean |
contains(int elem)
Returns true when the domain containts elem value. |
boolean |
contains(Object o)
Returns true when the domain contains the element o. |
Domain |
cup(Domain d)
Not implemented. |
IntDomain |
delete(int elem)
Returns a new domain obtained by deleting elem value. |
IntDomain |
delete(int lo,
int hi)
Returns a new domain obtained by deleting the interval lo..hi. |
Domain |
delete(Object o)
Returns a new domain obtained by deleting the element o (optional operation). |
Domain |
difference(Domain d)
Not implemented. |
Object |
element()
Returns the only element when the domain is a singleton. |
Iterator<Domain> |
elements()
Returns the iterator of domain elements. |
boolean |
equals(Domain d0)
Returns true when the domain is equal to another domain d. |
Domain |
insert(Object o)
Not implemented. |
int |
max()
Returns the current maximum value of the domain. |
int |
min()
Returns the current minimum value of the domain. |
void |
remove(int elem)
Removes elem from the domain. |
void |
remove(Object o)
Removes o from the domain. |
String |
toString()
|
int |
value()
Returns the current only value when the domain is a singleton. |
Methods inherited from class jp.ac.kobe_u.cs.cream.Domain |
---|
isEmpty, size |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MIN_VALUE
public static final int MAX_VALUE
public static IntDomain EMPTY
public static IntDomain FULL
Constructor Detail |
---|
public IntDomain()
public IntDomain(int value)
value
- the singleton valuepublic IntDomain(int min, int max)
min
- the lower boundmax
- the upper boundMethod Detail |
---|
public boolean equals(Domain d0)
Domain
equals
in class Domain
d0
- another domain
public Object clone()
Domain
clone
in class Domain
public Iterator<Domain> elements()
Domain
elements
in class Domain
public int min() throws NoSuchElementException
NoSuchElementException
public int max() throws NoSuchElementException
NoSuchElementException
public int value() throws NoSuchElementException
NoSuchElementException
public Object element() throws NoSuchElementException
Domain
element
in class Domain
NoSuchElementException
public boolean contains(int elem)
elem
- the integer value to be checked
public boolean contains(Object o)
Domain
contains
in class Domain
o
- the element to be checked
public Domain insert(Object o)
insert
in class Domain
o
-
public void remove(int elem)
elem
- the integer value to be removedpublic void remove(Object o)
o
- the object to be removedpublic IntDomain delete(int elem)
elem
- the integer value to be deleted
public Domain delete(Object o)
Domain
delete
in class Domain
o
- an element to be deleted
public IntDomain delete(int lo, int hi)
lo
- the lower bound of the interval to be deletedhi
- the upper bound of the interval to be deleted
public Domain cap(Domain d)
Domain
cap
in class Domain
d
- another domain
public Domain cup(Domain d)
cup
in class Domain
d
-
public Domain difference(Domain d)
difference
in class Domain
d
-
public IntDomain capInterval(int lo, int hi)
lo
- the lower boundhi
- the upper bound
public String toString()
toString
in class Object
|
Cream version 1.4 Core API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |