Package org.xcsp.common.domains
Interface Values.IntegerEntity
-
- All Superinterfaces:
Comparable<Values.IntegerEntity>
- All Known Implementing Classes:
Values.IntegerInterval,Values.IntegerValue
- Enclosing class:
- Values
public static interface Values.IntegerEntity extends Comparable<Values.IntegerEntity>
An interface used to denote integer entities, i.e., either integer values or integer intervals. These entities are present when defining integer domains or unary integer extensional constraints.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description intcompareContains(long l)Returns 0 if the entity contains the specified value, -1 if the values of the entity are strictly smaller than the specified value, and +1 if the values of the entity are strictly greater than the specified value.default intcompareTo(Values.IntegerEntity p)longgreatest()Returns the greatest value of the entity (the value itself or the upper bound of the interval).booleanisSingleton()Returns true iff the entity is an integer value or an integer interval containing only one valuestatic longnValues(Values.IntegerEntity[] pieces)Returns the number of values in the specified array of integer entities.static Values.IntegerEntityparse(String s)Returns an integer entity (integer value or integer interval) obtained by parsing the specified string.static Values.IntegerEntity[]parseSeq(String seq)Returns an array of integer entities (integer values or integer intervals) obtained by parsing the specified string.longsmallest()Returns the smallest value of the entity (the value itself or the lower bound of the interval).static int[]toIntArray(Values.IntegerEntity[] pieces)Returns an array of integers with all values represented by the specified integer entities.static int[]toIntArray(Values.IntegerEntity[] pieces, int limit)Returns an array of integers with all values represented by the specified integer entities.longwidth()Returns the number of values represented by the entity, or -1 if this number does not fit within along.
-
-
-
Method Detail
-
parse
static Values.IntegerEntity parse(String s)
Returns an integer entity (integer value or integer interval) obtained by parsing the specified string.
-
parseSeq
static Values.IntegerEntity[] parseSeq(String seq)
Returns an array of integer entities (integer values or integer intervals) obtained by parsing the specified string.
-
nValues
static long nValues(Values.IntegerEntity[] pieces)
Returns the number of values in the specified array of integer entities. Importantly, note that -1 is returned if this number is infinite, or simply greater thanLong.MAX_VALUE.
-
toIntArray
static int[] toIntArray(Values.IntegerEntity[] pieces, int limit)
Returns an array of integers with all values represented by the specified integer entities. Note that null is returned if the number of values is infinite or greater than the specified limit value.
-
toIntArray
static int[] toIntArray(Values.IntegerEntity[] pieces)
Returns an array of integers with all values represented by the specified integer entities. Note that null is returned if the number of values is infinite or greater than Integer.MAX_VALUE
-
compareTo
default int compareTo(Values.IntegerEntity p)
- Specified by:
compareToin interfaceComparable<Values.IntegerEntity>
-
isSingleton
boolean isSingleton()
Returns true iff the entity is an integer value or an integer interval containing only one value
-
smallest
long smallest()
Returns the smallest value of the entity (the value itself or the lower bound of the interval).
-
greatest
long greatest()
Returns the greatest value of the entity (the value itself or the upper bound of the interval).
-
width
long width()
Returns the number of values represented by the entity, or -1 if this number does not fit within along.
-
compareContains
int compareContains(long l)
Returns 0 if the entity contains the specified value, -1 if the values of the entity are strictly smaller than the specified value, and +1 if the values of the entity are strictly greater than the specified value.
-
-