Known Direct Subclasses
AtomicInteger,
AtomicLong,
BigDecimal,
BigInteger,
Byte,
Double,
Float,
Integer,
Long,
Rational,
Short
AtomicInteger |
An int value that may be updated atomically. |
AtomicLong |
A long value that may be updated atomically. |
BigDecimal |
An immutable arbitrary-precision signed decimal. |
BigInteger |
An immutable arbitrary-precision signed integer. |
Byte |
The wrapper for the primitive type byte . |
Double |
The wrapper for the primitive type double . |
Float |
The wrapper for the primitive type float . |
Integer |
The wrapper for the primitive type int . |
Long |
The wrapper for the primitive type long . |
Rational |
An immutable data type representation a rational number. |
Short |
The wrapper for the primitive type short . |
|
Summary
Public Constructors |
|
Number()
Empty default constructor.
|
Public Methods |
byte
|
byteValue()
Returns this object's value as a byte.
|
abstract
double
|
doubleValue()
Returns this object's value as a double.
|
abstract
float
|
floatValue()
Returns this object's value as a float.
|
abstract
int
|
intValue()
Returns this object's value as an int.
|
abstract
long
|
longValue()
Returns this object's value as a long.
|
short
|
shortValue()
Returns this object's value as a short.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
Public Constructors
public
Number
()
Empty default constructor.
Public Methods
public
byte
byteValue
()
Returns this object's value as a byte. Might involve rounding and/or
truncating the value, so it fits into a byte.
Returns
- the primitive byte value of this object.
public
abstract
double
doubleValue
()
Returns this object's value as a double. Might involve rounding.
Returns
- the primitive double value of this object.
public
abstract
float
floatValue
()
Returns this object's value as a float. Might involve rounding.
Returns
- the primitive float value of this object.
public
abstract
int
intValue
()
Returns this object's value as an int. Might involve rounding and/or
truncating the value, so it fits into an int.
Returns
- the primitive int value of this object.
public
abstract
long
longValue
()
Returns this object's value as a long. Might involve rounding and/or
truncating the value, so it fits into a long.
Returns
- the primitive long value of this object.
public
short
shortValue
()
Returns this object's value as a short. Might involve rounding and/or
truncating the value, so it fits into a short.
Returns
- the primitive short value of this object.