Package org.jacop.core
Class IntervalDomainValueEnumeration
- java.lang.Object
-
- org.jacop.core.ValueEnumeration
-
- org.jacop.core.IntervalDomainValueEnumeration
-
public class IntervalDomainValueEnumeration extends ValueEnumeration
Defines a methods for enumerating values contain in the domain.- Version:
- 4.7
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
current
(package private) IntervalDomain
domain
(package private) Interval
i
(package private) int
intervalNo
(package private) int
maxIntervalNo
-
Constructor Summary
Constructors Constructor Description IntervalDomainValueEnumeration(IntervalDomain dom)
It create an enumeration for a given domain.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
domainHasChanged()
This function is called to inform enumeration of the change of the domain it enumerates over.boolean
hasMoreElements()
It checks if the value enumeration has more elements.int
nextElement()
It returns the next element in the enumeration.
-
-
-
Field Detail
-
current
int current
-
domain
IntervalDomain domain
-
i
Interval i
-
intervalNo
int intervalNo
-
maxIntervalNo
int maxIntervalNo
-
-
Constructor Detail
-
IntervalDomainValueEnumeration
public IntervalDomainValueEnumeration(IntervalDomain dom)
It create an enumeration for a given domain.- Parameters:
dom
- domain for which value enumeration is created.
-
-
Method Detail
-
hasMoreElements
public boolean hasMoreElements()
Description copied from class:ValueEnumeration
It checks if the value enumeration has more elements.- Specified by:
hasMoreElements
in classValueEnumeration
- Returns:
- true if more elements can be enumerated, false otherwise.
-
nextElement
public int nextElement()
Description copied from class:ValueEnumeration
It returns the next element in the enumeration.- Specified by:
nextElement
in classValueEnumeration
- Returns:
- the next element.
-
domainHasChanged
public void domainHasChanged()
Description copied from class:ValueEnumeration
This function is called to inform enumeration of the change of the domain it enumerates over. The enumeration will update its private data structure and if possible adapt next element to the closest (on the right) which is still in the domain.- Specified by:
domainHasChanged
in classValueEnumeration
-
-