|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnenok.va.Domain
public class Domain
The domain of a valuation is a set of variables and this class offers a corresponding pre-implementation. Domains are serializable such that they can be transmitted between network hosts. Furthermore, this type is immutable for synchronization issues.
Field Summary | |
---|---|
static Domain |
EMPTY
Empty domain as a constant. |
Constructor Summary | |
---|---|
Domain(Collection<? extends Variable> vars)
Constructor: |
|
Domain(Variable... vars)
Constructor: |
Method Summary | |
---|---|
List<Variable> |
asList()
Returns the current domain as a list of variables. |
boolean |
contains(Variable var)
Does the current domain contain a given variable. |
static Domain |
difference(Domain dom1,
Domain dom2)
Computes the difference of the two domains. |
boolean |
equals(Object o)
|
int |
hashCode()
|
static Domain |
intersection(Domain dom1,
Domain dom2)
Computes the intersection of the two domains. |
Iterator<Variable> |
iterator()
|
static List<Domain> |
powerSet(Domain dom)
Builds the powerset of the domain given as argument. |
int |
size()
|
boolean |
subSetOf(Domain dom)
Tests, if this domain is a subset of the domain given as argument, i.e. if all variables of this are contained within the argument. |
Variable[] |
toArray()
Returns the current domain as an array of variables. |
String |
toString()
|
static Domain |
totalDomain(Collection<Locator> locs)
Computes the union domain of a collection of locators. |
static Domain |
totalDomain(Locator[] locs)
Computes the union domain of an array of locators. |
static Domain |
totalDomain(Valuation[] valuations)
Computes the union domain of an array of valuations. |
static Domain |
union(Collection<Domain> domains)
Computes the union of a collection of domains. |
static Domain |
union(Domain[] domains)
Computes the union of an array of domains. |
static Domain |
union(Domain dom1,
Domain dom2)
Computes the union of the two domains. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Domain EMPTY
Constructor Detail |
---|
public Domain(Variable... vars)
vars
- An arbitrary number of variables.public Domain(Collection<? extends Variable> vars)
vars
- A collection of variables.Method Detail |
---|
public int size()
public Iterator<Variable> iterator()
iterator
in interface Iterable<Variable>
Iterable.iterator()
public boolean subSetOf(Domain dom)
this
are contained within the argument.
dom
- The domain which is a possible superset.
true
, if this
is a subset of dom
.public boolean contains(Variable var)
var
- The variable to find in the current domain.
true
, if this
contains the given variable.public Variable[] toArray()
public List<Variable> asList()
public boolean equals(Object o)
equals
in class Object
Object.equals(java.lang.Object)
public String toString()
toString
in class Object
Object.toString()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public static Domain union(Domain dom1, Domain dom2)
dom1
- The first domain.dom2
- The second domain.
dom1
and dom2
.public static Domain union(Domain[] domains)
domains
- An array of domains.
public static Domain union(Collection<Domain> domains)
domains
- An collection of domains.
public static Domain intersection(Domain dom1, Domain dom2)
dom1
- The first domain.dom2
- The second domain.
dom1
and dom2
.public static Domain difference(Domain dom1, Domain dom2)
dom1
- The first domain.dom2
- The second domain.
dom1 / dom2
.public static Domain totalDomain(Valuation[] valuations)
valuations
- The array of valuations.
public static Domain totalDomain(Locator[] locs)
locs
- The array of locators.
public static Domain totalDomain(Collection<Locator> locs)
locs
- The collection of locators.
public static List<Domain> powerSet(Domain dom)
dom
- The domain whose powerset shall be built.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |