Package org.xcsp.common.domains
Class Values.IntegerValue
- java.lang.Object
-
- org.xcsp.common.domains.Values.IntegerValue
-
- All Implemented Interfaces:
Comparable<Values.IntegerEntity>
,Values.IntegerEntity
,Values.SimpleValue
- Enclosing class:
- Values
public static final class Values.IntegerValue extends Object implements Values.IntegerEntity, Values.SimpleValue
A class to represent an integer value.
-
-
Field Summary
Fields Modifier and Type Field Description long
v
The value of the integer.
-
Constructor Summary
Constructors Constructor Description IntegerValue(long v)
Builds an IntegerValue object with the specified value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.long
greatest()
Returns the greatest value of the entity (the value itself or the upper bound of the interval).boolean
isSingleton()
Returns true iff the entity is an integer value or an integer interval containing only one valuelong
smallest()
Returns the smallest value of the entity (the value itself or the lower bound of the interval).String
toString()
long
width()
Returns the number of values represented by the entity, or -1 if this number does not fit within along
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.xcsp.common.domains.Values.IntegerEntity
compareTo
-
-
-
-
Method Detail
-
isSingleton
public boolean isSingleton()
Description copied from interface:Values.IntegerEntity
Returns true iff the entity is an integer value or an integer interval containing only one value- Specified by:
isSingleton
in interfaceValues.IntegerEntity
-
smallest
public long smallest()
Description copied from interface:Values.IntegerEntity
Returns the smallest value of the entity (the value itself or the lower bound of the interval).- Specified by:
smallest
in interfaceValues.IntegerEntity
-
greatest
public long greatest()
Description copied from interface:Values.IntegerEntity
Returns the greatest value of the entity (the value itself or the upper bound of the interval).- Specified by:
greatest
in interfaceValues.IntegerEntity
-
width
public long width()
Description copied from interface:Values.IntegerEntity
Returns the number of values represented by the entity, or -1 if this number does not fit within along
.- Specified by:
width
in interfaceValues.IntegerEntity
-
compareContains
public int compareContains(long l)
Description copied from interface:Values.IntegerEntity
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.- Specified by:
compareContains
in interfaceValues.IntegerEntity
-
-