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 longvThe 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 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.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 valuelongsmallest()Returns the smallest value of the entity (the value itself or the lower bound of the interval).StringtoString()longwidth()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.IntegerEntityReturns true iff the entity is an integer value or an integer interval containing only one value- Specified by:
isSingletonin interfaceValues.IntegerEntity
-
smallest
public long smallest()
Description copied from interface:Values.IntegerEntityReturns the smallest value of the entity (the value itself or the lower bound of the interval).- Specified by:
smallestin interfaceValues.IntegerEntity
-
greatest
public long greatest()
Description copied from interface:Values.IntegerEntityReturns the greatest value of the entity (the value itself or the upper bound of the interval).- Specified by:
greatestin interfaceValues.IntegerEntity
-
width
public long width()
Description copied from interface:Values.IntegerEntityReturns the number of values represented by the entity, or -1 if this number does not fit within along.- Specified by:
widthin interfaceValues.IntegerEntity
-
compareContains
public int compareContains(long l)
Description copied from interface:Values.IntegerEntityReturns 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:
compareContainsin interfaceValues.IntegerEntity
-
-