Cream version 1.06 Core API Specification

jp.ac.kobe_u.cs.cream
Class Domain

java.lang.Object
  extended by jp.ac.kobe_u.cs.cream.Domain
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
IntDomain

public abstract class Domain
extends Object
implements Cloneable

Domains. This is an abstract class for domains.

Since:
1.0
See Also:
Variable

Constructor Summary
Domain()
           
 
Method Summary
abstract  Domain cap(Domain d)
          Returns a new domain of the intersection (optional operation).
abstract  Object clone()
          Returns true when the domain is empty.
abstract  boolean contains(Object o)
          Returns true when the domain contains the element o.
abstract  Domain cup(Domain d)
          Returns a new domain of the union (optional operation).
abstract  Domain delete(Object o)
          Returns a new domain obtained by deleting the element o (optional operation).
abstract  Domain difference(Domain d)
          Returns a new domain of the difference (optional operation).
abstract  Object element()
          Returns the only element when the domain is a singleton.
abstract  Iterator<Domain> elements()
          Returns the iterator of domain elements.
abstract  boolean equals(Domain d)
          Returns true when the domain is equal to another domain d.
abstract  Domain insert(Object o)
          Returns a new domain obtained by adding o as a new element (optional operation).
 boolean isEmpty()
          Returns true when the domain is empty.
 int size()
          Returns the size of the domain.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Domain

public Domain()
Method Detail

size

public int size()
Returns the size of the domain.

Returns:
the size

isEmpty

public boolean isEmpty()
Returns true when the domain is empty.

Returns:
true when the domain is empty

clone

public abstract Object clone()
Returns true when the domain is empty.

Overrides:
clone in class Object
Returns:
true when the domain is empty

equals

public abstract boolean equals(Domain d)
Returns true when the domain is equal to another domain d.

Parameters:
d - another domain
Returns:
true when the domain is equal to d

elements

public abstract Iterator<Domain> elements()
Returns the iterator of domain elements.

Returns:
the iterator of domain elements

element

public abstract Object element()
                        throws NoSuchElementException
Returns the only element when the domain is a singleton.

Returns:
the only element
Throws:
NoSuchElementException

contains

public abstract boolean contains(Object o)
Returns true when the domain contains the element o.

Parameters:
o - the element to be checked
Returns:
true when the domain contains o

insert

public abstract Domain insert(Object o)
Returns a new domain obtained by adding o as a new element (optional operation).

Parameters:
o - an element to be added
Returns:
the new domain

delete

public abstract Domain delete(Object o)
Returns a new domain obtained by deleting the element o (optional operation).

Parameters:
o - an element to be deleted
Returns:
the new domain

cap

public abstract Domain cap(Domain d)
Returns a new domain of the intersection (optional operation).

Parameters:
d - another domain
Returns:
the intersection

cup

public abstract Domain cup(Domain d)
Returns a new domain of the union (optional operation).

Parameters:
d - another domain
Returns:
the union

difference

public abstract Domain difference(Domain d)
Returns a new domain of the difference (optional operation).

Parameters:
d - another domain
Returns:
the difference

Cream version 1.06 Core API Specification

Cream: Constraint Programming Class Library for Java