java.lang
Class Number
java.lang.Object
|
+--java.lang.Number
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- BigDecimal, BigInteger, Byte, Double, Float, Integer, Long, Short
- public abstract class Number
- extends Object
- implements Serializable
Safe: The abstract class Number is the superclass of classes
BigDecimal, BigInteger,
Byte, Double, Float,
Integer, Long, and Short.
Subclasses of Number must provide methods to convert
the represented numeric value to byte, double,
float, int, long, and
short.
- Since:
- JDK1.0
- Version:
- 1.27, 12/03/01
- Author:
- Lee Boynton, Arthur van Hoff
- See Also:
java.lang.Byte,
java.lang.Double,
java.lang.Float,
java.lang.Integer,
java.lang.Long,
java.lang.Short,
Serialized Form
Field Summary
private static long
serialVersionUID
use serialVersionUID from JDK 1.0.2 for interoperability
Constructor Summary
Method Summary
byte
byteValue()
Enabled: Returns the value of the specified number as a
byte.
abstract double
doubleValue()
Enabled: Returns the value of the specified number as a
double.
abstract float
floatValue()
Enabled: Returns the value of the specified number as a
float.
abstract int
intValue()
Enabled: Returns the value of the specified number as an
int.
abstract long
longValue()
Enabled: Returns the value of the specified number as a
long.
short
shortValue()
Enabled: Returns the value of the specified number as a
short.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail
serialVersionUID
private static final long serialVersionUID
- use serialVersionUID from JDK 1.0.2 for interoperability
Constructor Detail
Number
public Number()
- Enabled:
Method Detail
intValue
public abstract int intValue()
- Enabled: Returns the value of the specified number as an
int.
This may involve rounding or truncation.
-
- Returns:
- the numeric value represented by this object after conversion
to type
int.
longValue
public abstract long longValue()
- Enabled: Returns the value of the specified number as a
long.
This may involve rounding or truncation.
-
- Returns:
- the numeric value represented by this object after conversion
to type
long.
floatValue
public abstract float floatValue()
- Enabled: Returns the value of the specified number as a
float.
This may involve rounding.
-
- Returns:
- the numeric value represented by this object after conversion
to type
float.
doubleValue
public abstract double doubleValue()
- Enabled: Returns the value of the specified number as a
double.
This may involve rounding.
-
- Returns:
- the numeric value represented by this object after conversion
to type
double.
byteValue
public byte byteValue()
- Enabled: Returns the value of the specified number as a
byte.
This may involve rounding or truncation.
-
- Returns:
- the numeric value represented by this object after conversion
to type
byte. - Since:
- JDK1.1
shortValue
public short shortValue()
- Enabled: Returns the value of the specified number as a
short.
This may involve rounding or truncation.
-
- Returns:
- the numeric value represented by this object after conversion
to type
short. - Since:
- JDK1.1