|
2004.04.29 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.lang.Number
|
+--com.jdc.math.Number
|
+--com.jdc.math.Integer
| Field Summary |
| Fields inherited from interface com.jdc.util.DefaultLocale |
DEFAULT_LOCALE |
| Constructor Summary | |
Integer()
Constructs a new Integer object with a value of zero, i.e. |
|
Integer(long value)
Constructs a new Integer object for the specified long
value. |
|
Integer(String value)
Constructs a new Integer object for the specified String
value. |
|
| Method Summary | |
Integer |
add(long value)
Adds a long value to this Integer value. |
Integer |
add(Number number)
Adds another Number value to this Integer value. |
Integer |
divide(long value)
Divides a long value into to this Integer value. |
Integer |
divide(Number number)
Divides another Number value into this Integer value. |
double |
doubleValue()
Converts this Integer to a double. |
boolean |
equals(Object object)
Compares this Integer with the specified Object for
equality. |
float |
floatValue()
Converts this Integer to a float. |
String |
format()
Returns a formatted String representation of this Integer
object. |
Locale |
getLocale()
Returns the Locale object to be used when formatting this
Integer object. |
int |
hashCode()
Returns the hash code for this Integer object. |
int |
intValue()
Converts this Integer to an int. |
boolean |
isNaN()
Returns true if the value represented by this Integer
object is Not-a-Number, i.e. |
long |
longValue()
Converts this Integer to a long. |
static void |
main(String[] args)
Executes the unit tests for the Integer class. |
Integer |
multiply(long value)
Multiplies this Integer value by long value. |
Integer |
multiply(Number number)
Multiplies this Integer value by another Number value. |
Integer |
set(long value)
Sets the value for this Integer object from a primitive
long value. |
Integer |
set(String value)
Sets the value for this Integer object. |
Integer |
setLocale(Locale locale)
Sets the Locale object to be used when formatting this
Integer object. |
Integer |
subtract(long value)
Subtracts a long value from this Integer value.. |
Integer |
subtract(Number number)
Subtracts another Number value from this Integer value. |
BigInteger |
toBigInteger()
Returns a BigInteger representation of this Integer
object. |
String |
toString()
Returns a String representation of this Integer object. |
| Methods inherited from class java.lang.Number |
byteValue, shortValue |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Integer()
Integer object with a value of zero, i.e. 0.
public Integer(long value)
Integer object for the specified long
value.
public Integer(String value)
Integer object for the specified String
value.
BigInteger.BigInteger(String)| Method Detail |
public Integer add(long value)
long value to this Integer value.
Integer object.public Integer add(Number number)
Number value to this Integer value. A
Number value may be a Integer or Integer
object.
Integer object.public Integer divide(long value)
long value into to this Integer value.
Integer object.public Integer divide(Number number)
Number value into this Integer value.
A Number value may be a Integer or Integer
object.
Integer object.public double doubleValue()
Integer to a double. Similar to the
double-to-float narrowing primitive conversion defined in The Java Language
Specification: if this Integer has too great a magnitude to
represent as a double, it will be converted to
DOUBLE.NEGATIVE_INFINITY or DOUBLE.POSITIVE_INFINITY
as appropriate.
doubleValue in class Numberpublic boolean equals(Object object)
Integer with the specified Object for
equality. This method considers two Integer objectss equal only
if they are equal in value and scale (thus 2.0 is not equal to 2.00 when
compared by this method).
equals in class ObjectTrue if and only if the specified Object is
a Integer whose value and scale are equal to this Integer
object.public float floatValue()
Integer to a float. Similar to the
double-to-float narrowing primitive conversion defined in The Java Language
Specification: if this Integer has too great a magnitude to
represent as a float, it will be converted to
FLOAT.NEGATIVE_INFINITY or FLOAT.POSITIVE_INFINITY
as appropriate.
- Overrides:
floatValue in class Number
- Returns:
- The numeric value represented by this object after conversion to type float.
public String format()
String representation of this Integer
object.
String representation of this Integer object.public Locale getLocale()
Locale object to be used when formatting this
Integer object. If not specified, the locale object for the
United States, i.e. Locale.US is used.
Locale object to be used when formatting this Integer object.public int hashCode()
Integer object. Note that two
Integer objects that are numerically equal but differ in scale,
e.g. 2.0 and 2.00, will generally not have the same hash code.
hashCode in class ObjectInteger object.public int intValue()
Integer to an int. Standard narrowing
primitive conversion as defined in The Java Language Specification: any
fractional part of this Integer will be discarded, and if the
resulting Integer is too big to fit in an int, only
the low-order 32 bits are returned.
intValue in class Numberpublic boolean isNaN()
true if the value represented by this Integer
object is Not-a-Number, i.e. NaN.
isNaN in class NumberTrue if the value is Not-a-Number, i.e. NaN.
False if the value is a valid decimal number.public long longValue()
Integer to a long. Standard narrowing
primitive conversion as defined in The Java Language Specification: any
fractional part of this Integer will be discarded, and if the
resulting Integer is too big to fit in a long, only
the low-order 64 bits are returned.
longValue in class Numberpublic Integer multiply(long value)
Integer value by long value.
Integer object.public Integer multiply(Number number)
Integer value by another Number value.
A Number value may be a Integer or Integer
object.
Integer object.public Integer set(long value)
Integer object from a primitive
long value.
Integer object.public Integer set(String value)
Integer object.
Integer object.public Integer setLocale(Locale locale)
Locale object to be used when formatting this
Integer object.
Integer object.public Integer subtract(long value)
long value from this Integer value..
Integer object.public Integer subtract(Number number)
Number value from this Integer value.
A Number value may be a Integer or Integer
object.
Integer object.public BigInteger toBigInteger()
BigInteger representation of this Integer
object. If the value represented by this Integer object is
Not-a-Number, null is returned.
BigInteger representation of this Integer object.public String toString()
String representation of this Integer object.
The primitive double value represented by this object is converted to a
String and returned.
toString in class ObjectString representation of this Integer object.public static void main(String[] args)
|
2004.04.29 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||