|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectNumber
UnlimitedInteger
@UML(identifier="UnlimitedInteger", specification=ISO_19103) public final class 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.
Field Summary | |
---|---|
static int |
MAX_VALUE
A constant holding the maximum finite value a UnlimitedInteger can have. |
static int |
MIN_VALUE
A constant holding the minimum finite value a UnlimitedInteger can have. |
static UnlimitedInteger |
NEGATIVE_INFINITY
A constant holding the negative infinity. |
static UnlimitedInteger |
POSITIVE_INFINITY
A constant holding the positive infinity. |
Constructor Summary | |
---|---|
UnlimitedInteger(int value)
Constructs a newly allocated UnlimitedInteger object that represents the specified
int value. |
Method Summary | |
---|---|
int |
compareTo(Object other)
Compares two UnlimitedInteger objects numerically. |
double |
doubleValue()
Returns the value of this UnlimitedInteger as a double . |
boolean |
equals(Object object)
Compares this number with the specified object for equality. |
float |
floatValue()
Returns the value of this UnlimitedInteger as a float . |
int |
hashCode()
Returns a hash code for this integer. |
int |
intValue()
Returns the value of this UnlimitedInteger as an int . |
boolean |
isInfinite()
Returns true if this integer represents a positive or negative infinity. |
long |
longValue()
Returns the value of this UnlimitedInteger as a long . |
String |
toString()
Returns a string representation of this number. |
Methods inherited from class Number |
---|
byteValue, shortValue |
Methods inherited from class Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final UnlimitedInteger NEGATIVE_INFINITY
public static final UnlimitedInteger POSITIVE_INFINITY
public static final int MIN_VALUE
UnlimitedInteger
can have.
public static final int MAX_VALUE
UnlimitedInteger
can have.
Constructor Detail |
---|
public UnlimitedInteger(int value)
UnlimitedInteger
object that represents the specified
int
value. Integer.MAX_VALUE
and MIN_VALUE
maps
to positive and negative infinities respectively.
Method Detail |
---|
public boolean isInfinite()
true
if this integer represents a positive or negative infinity.
public int intValue()
UnlimitedInteger
as an int
. Positive and negative
infinities map to Integer.MAX_VALUE
and MIN_VALUE
respectively.
intValue
in class Number
public long longValue()
UnlimitedInteger
as a long
. Positive and negative
infinities map to Long.MAX_VALUE
and MIN_VALUE
respectively.
longValue
in class Number
public float floatValue()
UnlimitedInteger
as a float
.
Positive and negative infinities map to Float.POSITIVE_INFINITY
and NEGATIVE_INFINITY
respectively.
floatValue
in class Number
public double doubleValue()
UnlimitedInteger
as a double
.
Positive and negative infinities map to Double.POSITIVE_INFINITY
and NEGATIVE_INFINITY
respectively.
doubleValue
in class Number
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object object)
equals
in class Object
public int compareTo(Object other)
UnlimitedInteger
objects numerically.
compareTo
in interface Comparable
other
- the unlimited integer to be compared.
0
if this UnlimitedInteger
is equal to the given value,
-1
if this UnlimitedInteger
is numerically less than the given value, and
+1
if this UnlimitedInteger
is numerically greater than the given value,
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |