Back to index

plt-scheme  4.2.1
Public Member Functions | Static Package Attributes | Static Private Attributes
java.lang.Number Class Reference

Number is a generic superclass of all the numeric classes, including the wrapper classes Byte, Short, Integer, Long, Float, and Double. More...

Inheritance diagram for java.lang.Number:
Inheritance graph
[legend]
Collaboration diagram for java.lang.Number:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Number ()
 The basic constructor (often called implicitly).
abstract int intValue ()
 Return the value of this Number as an int.
abstract long longValue ()
 Return the value of this Number as a long.
abstract float floatValue ()
 Return the value of this Number as a float.
abstract double doubleValue ()
 Return the value of this Number as a float.
byte byteValue ()
 Return the value of this Number as a byte.
short shortValue ()
 Return the value of this Number as a short.

Static Package Attributes

static final char[] digits
 Table for calculating digits, used in Character, Long, and Integer.

Static Private Attributes

static final long serialVersionUID = -8742448824652078965L
 Compatible with JDK 1.1+.

Detailed Description

Number is a generic superclass of all the numeric classes, including the wrapper classes Byte, Short, Integer, Long, Float, and Double.

Also worth mentioning are the classes in java.math.

It provides ways to convert numeric objects to any primitive.

Author:
Paul Fisher
John Keiser
Warren Levy
Eric Blake ebb9@.nosp@m.emai.nosp@m.l.byu.nosp@m..edu
Since:
1.0 updated to 1.4

Definition at line 58 of file Number.java.


Constructor & Destructor Documentation

The basic constructor (often called implicitly).

Definition at line 78 of file Number.java.

  {
  }

Member Function Documentation

Return the value of this Number as a byte.

Returns:
the byte value
Since:
1.1

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

Definition at line 116 of file Number.java.

  {
    return (byte) intValue();
  }

Here is the call graph for this function:

abstract double java.lang.Number.doubleValue ( ) [pure virtual]

Return the value of this Number as a float.

Returns:
the double value

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

abstract float java.lang.Number.floatValue ( ) [pure virtual]

Return the value of this Number as a float.

Returns:
the float value

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

abstract int java.lang.Number.intValue ( ) [pure virtual]

Return the value of this Number as an int.

Returns:
the int value

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

Here is the caller graph for this function:

abstract long java.lang.Number.longValue ( ) [pure virtual]

Return the value of this Number as a long.

Returns:
the long value

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

short java.lang.Number.shortValue ( ) [inline]

Return the value of this Number as a short.

Returns:
the short value
Since:
1.1

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

Definition at line 127 of file Number.java.

  {
    return (short) intValue();
  }

Here is the call graph for this function:


Member Data Documentation

final char [] java.lang.Number.digits [static, package]
Initial value:
 {
    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
    'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
    'u', 'v', 'w', 'x', 'y', 'z',
  }

Table for calculating digits, used in Character, Long, and Integer.

Definition at line 68 of file Number.java.

final long java.lang.Number.serialVersionUID = -8742448824652078965L [static, private]

Compatible with JDK 1.1+.

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

Definition at line 63 of file Number.java.


The documentation for this class was generated from the following file: