java::lang::Number Class Reference

Inheritance diagram for java::lang::Number:

Inheritance graph
java::lang::Bytejava::lang::Doublejava::lang::Floatjava::lang::Integerjava::lang::Longjava::lang::Shortjava::lang::Object
[legend]
Collaboration diagram for java::lang::Number:

Collaboration graph
java::lang::Object
[legend]

List of all members.


Detailed Description

The abstract class Number is the superclass of classes 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.

Author:
Yuh-Jye Chang
Version:
1.25, 02/02/00
Since:
JDK1.0

Public Member Functions

virtual jint intValue () const =0
 Returns the value of the specified number as an int.
virtual jlong longValue () const =0
 Returns the value of the specified number as a long.
virtual jfloat floatValue () const =0
 Returns the value of the specified number as a float.
virtual jdouble doubleValue () const =0
 Returns the value of the specified number as a double.
virtual jbyte byteValue () const
 Returns the value of the specified number as a byte.
virtual jshort shortValue () const
 Returns the value of the specified number as a short.

Member Function Documentation

virtual jint java::lang::Number::intValue (  )  const [pure virtual]

Returns the value of the specified number as an int.

This may involve rounding.

Returns:
the numeric value represented by this object after conversion to type int.

Implemented in java::lang::Byte, java::lang::Double, java::lang::Float, java::lang::Integer, java::lang::Long, and java::lang::Short.

virtual jlong java::lang::Number::longValue (  )  const [pure virtual]

Returns the value of the specified number as a long.

This may involve rounding.

Returns:
the numeric value represented by this object after conversion to type long.

Implemented in java::lang::Byte, java::lang::Double, java::lang::Float, java::lang::Integer, java::lang::Long, and java::lang::Short.

virtual jfloat java::lang::Number::floatValue (  )  const [pure virtual]

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.

Implemented in java::lang::Byte, java::lang::Double, java::lang::Float, java::lang::Integer, java::lang::Long, and java::lang::Short.

virtual jdouble java::lang::Number::doubleValue (  )  const [pure virtual]

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.

Implemented in java::lang::Byte, java::lang::Double, java::lang::Float, java::lang::Integer, java::lang::Long, and java::lang::Short.

virtual jbyte java::lang::Number::byteValue (  )  const [virtual]

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

Reimplemented in java::lang::Byte, java::lang::Double, java::lang::Float, java::lang::Integer, java::lang::Long, and java::lang::Short.

virtual jshort java::lang::Number::shortValue (  )  const [virtual]

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

Reimplemented in java::lang::Byte, java::lang::Double, java::lang::Float, java::lang::Integer, java::lang::Long, and java::lang::Short.


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:56:39 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3