Known Direct Subclasses
AtomicInteger |
An int value that may be updated atomically. |
AtomicLong |
A long value that may be updated atomically. |
BigDecimal |
Immutable, arbitrary-precision signed decimal numbers. |
BigInteger |
Immutable arbitrary-precision integers. |
Byte |
The Byte class wraps a value of primitive type byte
in an object. |
Double |
The Double class wraps a value of the primitive type
double in an object. |
Float |
The Float class wraps a value of primitive type
float in an object. |
Integer |
The Integer class wraps a value of the primitive type
int in an object. |
Long |
The Long class wraps a value of the primitive type long in an object. |
Short |
The Short class wraps a value of primitive type short in an object. |
|
Class Overview
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
.
Summary
Public Methods |
byte
|
byteValue()
Returns the value of the specified number as a byte .
|
abstract
double
|
doubleValue()
Returns the value of the specified number as a double .
|
abstract
float
|
floatValue()
Returns the value of the specified number as a float .
|
abstract
int
|
intValue()
Returns the value of the specified number as an int .
|
abstract
long
|
longValue()
Returns the value of the specified number as a long .
|
short
|
shortValue()
Returns the value of the specified number as a short .
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
Public Constructors
Public Methods
public
byte
byteValue
()
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
.
public
abstract
double
doubleValue
()
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
.
public
abstract
float
floatValue
()
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
.
public
abstract
int
intValue
()
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
.
public
abstract
long
longValue
()
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
.
public
short
shortValue
()
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
.