Package org.jacop.core
Class Interval
java.lang.Object
org.jacop.core.Interval
- All Implemented Interfaces:
Cloneable
Defines interval of numbers which is part of FDV definition which consist of
one or several intervals.
- Version:
- 4.10
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
It checks equality between intervals.int
max()
It returns the right bound of the interval (maximum value).int
min()
It returns the left range of the interval (minimum value).boolean
It checks if an intervals contains only one value (singleton).boolean
singleton
(int c) It checks if an intervals contains only value c.toString()
-
Field Details
-
min
public final int minIt specifies the minimal value in the interval. -
max
public final int maxIt specifies the maximal value in the interval.
-
-
Constructor Details
-
Interval
public Interval()It creates the largest possible interval. -
Interval
public Interval(int min, int max) It creates an interval with a given minimum and maximal value.- Parameters:
min
- the minimal value in the interval (the left bound).max
- the maximal value in the interval (the right bound).
-
-
Method Details
-
clone
-
eq
It checks equality between intervals.- Parameters:
interval
- the inerval to which the comparison is made.- Returns:
- true if an input interval is equal to this one.
-
max
public int max()It returns the right bound of the interval (maximum value).- Returns:
- the maximal value from the interval.
-
min
public int min()It returns the left range of the interval (minimum value).- Returns:
- the minimal value from the interval.
-
singleton
public boolean singleton()It checks if an intervals contains only one value (singleton).- Returns:
- true if domain has only one value.
-
singleton
public boolean singleton(int c) It checks if an intervals contains only value c.- Parameters:
c
- integer value to which the singleton is compared to.- Returns:
- true if variable has a singleton domain and it is equal to value c.
-
toString
-