Package org.geotools.api.util
Class UnlimitedInteger
- All Implemented Interfaces:
- Serializable,- Comparable<UnlimitedInteger>
An integer with associated infinite flag. This implementation uses 
Integer.MAX_VALUE as
 a sentinel value for positive infinity. This approach is consistent with J2SE Collection.size()
 contract. For consistency, Integer.MIN_VALUE is a sentinal value for negative infinity.- Since:
- GeoAPI 2.1
- Author:
- Jody Garnett (Refractions Research), Martin Desruisseaux (IRD)
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intA constant holding the maximum finite value aUnlimitedIntegercan have.static final intA constant holding the minimum finite value aUnlimitedIntegercan have.static final UnlimitedIntegerA constant holding the negative infinity.static final UnlimitedIntegerA constant holding the positive infinity.
- 
Constructor SummaryConstructorsConstructorDescriptionUnlimitedInteger(int value) Constructs a newly allocatedUnlimitedIntegerobject that represents the specifiedintvalue.
- 
Method SummaryModifier and TypeMethodDescriptionintcompareTo(UnlimitedInteger other) Compares twoUnlimitedIntegerobjects numerically.doubleReturns the value of thisUnlimitedIntegeras adouble.booleanCompares this number with the specified object for equality.floatReturns the value of thisUnlimitedIntegeras afloat.inthashCode()Returns a hash code for this integer.intintValue()Returns the value of thisUnlimitedIntegeras anint.booleanReturnstrueif this integer represents a positive or negative infinity.longReturns the value of thisUnlimitedIntegeras along.toString()Returns a string representation of this number.Methods inherited from class NumberbyteValue, shortValue
- 
Field Details- 
NEGATIVE_INFINITYA constant holding the negative infinity.
- 
POSITIVE_INFINITYA constant holding the positive infinity.
- 
MIN_VALUEpublic static final int MIN_VALUEA constant holding the minimum finite value aUnlimitedIntegercan have.- See Also:
 
- 
MAX_VALUEpublic static final int MAX_VALUEA constant holding the maximum finite value aUnlimitedIntegercan have.- See Also:
 
 
- 
- 
Constructor Details- 
UnlimitedIntegerpublic UnlimitedInteger(int value) Constructs a newly allocatedUnlimitedIntegerobject that represents the specifiedintvalue.Integer.MAX_VALUEandMIN_VALUEmaps to positive and negative infinities respectively.
 
- 
- 
Method Details- 
isInfinitepublic boolean isInfinite()Returnstrueif this integer represents a positive or negative infinity.
- 
intValuepublic int intValue()Returns the value of thisUnlimitedIntegeras anint. Positive and negative infinities map toInteger.MAX_VALUEandMIN_VALUErespectively.
- 
longValuepublic long longValue()Returns the value of thisUnlimitedIntegeras along. Positive and negative infinities map toLong.MAX_VALUEandMIN_VALUErespectively.
- 
floatValuepublic float floatValue()Returns the value of thisUnlimitedIntegeras afloat. Positive and negative infinities map toFloat.POSITIVE_INFINITYandNEGATIVE_INFINITYrespectively.- Specified by:
- floatValuein class- Number
 
- 
doubleValuepublic double doubleValue()Returns the value of thisUnlimitedIntegeras adouble. Positive and negative infinities map toDouble.POSITIVE_INFINITYandNEGATIVE_INFINITYrespectively.- Specified by:
- doubleValuein class- Number
 
- 
toStringReturns a string representation of this number.
- 
hashCodepublic int hashCode()Returns a hash code for this integer.
- 
equalsCompares this number with the specified object for equality.
- 
compareToCompares twoUnlimitedIntegerobjects numerically.- Specified by:
- compareToin interface- Comparable<UnlimitedInteger>
- Parameters:
- other- the unlimited integer to be compared.
- Returns:
- 0if this- UnlimitedIntegeris equal to the given value,- -1if this- UnlimitedIntegeris numerically less than the given value, and- +1if this- UnlimitedIntegeris numerically greater than the given value,
 
 
-