java::lang::Byte Class Reference

Inheritance diagram for java::lang::Byte:

Inheritance graph
java::lang::Numberjava::lang::Objectjava::lang::Interfacejava::lang::Comparable
[legend]
Collaboration diagram for java::lang::Byte:

Collaboration graph
java::lang::Numberjava::lang::Objectjava::lang::Interfacejava::lang::Comparable
[legend]

List of all members.


Detailed Description

The Byte class is the standard wrapper for byte values.

Author:
Nakul Saraiya

Yuh-Jye Chang

Version:
1.20, 02/02/00
See also:
java.lang.Number
Since:
JDK1.1

Public Member Functions

 Byte (jbyte _value=0)
 Constructs a Byte object initialized to the specified byte value.
 operator jbyte & ()
virtual jbyte byteValue () const
 Returns the value of this Byte as a byte.
virtual jshort shortValue () const
 Returns the value of this Byte as a short.
virtual jint intValue () const
 Returns the value of this Byte as an int.
virtual jlong longValue () const
 Returns the value of this Byte as a long.
virtual jfloat floatValue () const
 Returns the value of this Byte as a float.
virtual jdouble doubleValue () const
 Returns the value of this Byte as a double.
virtual jboolean equals (const Object &src) const
 Compares this object to the specified object.
virtual jint hashCode () const
 Returns a hashcode for this Byte.
virtual jint compareTo (const Object &src) const
 Compares this Byte to another Object.
String toString () const
 Returns a String object representing this Byte's value.

Static Public Member Functions

static jbyte parseByte (const String &s, jint radix=10)
 Assuming the specified String represents a byte, returns that byte's value.
static const Byte valueOf (const String &s, jint radix=10)
 Assuming the specified String represents a byte, returns a new Byte object initialized to that value.

Static Public Attributes

static const jbyte MIN_VALUE
 The smallest value of type byte.
static const jbyte MAX_VALUE
 The largest value of type byte.

Constructor & Destructor Documentation

java::lang::Byte::Byte ( jbyte  _value = 0  ) 

Constructs a Byte object initialized to the specified byte value.

Parameters:
value the initial value of the Byte


Member Function Documentation

static jbyte java::lang::Byte::parseByte ( const String s,
jint  radix = 10 
) [static]

Assuming the specified String represents a byte, returns that byte's value.

Throws an exception if the String cannot be parsed as a byte.

Parameters:
s the String containing the byte
radix the radix to be used
Returns:
the parsed value of the byte
Exceptions:
NumberFormatException If the String does not contain a parsable byte.

static const Byte java::lang::Byte::valueOf ( const String s,
jint  radix = 10 
) [static]

Assuming the specified String represents a byte, returns a new Byte object initialized to that value.

Throws an exception if the String cannot be parsed as a byte.

Parameters:
s the String containing the integer
radix the radix to be used
Returns:
the Byte instance representing the parsed byte value
Exceptions:
NumberFormatException If the String does not contain a parsable byte.

java::lang::Byte::operator jbyte & (  ) 

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

Returns the value of this Byte as a byte.

Since:
JDK1.1

Reimplemented from java::lang::Number.

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

Returns the value of this Byte as a short.

Since:
JDK1.1

Reimplemented from java::lang::Number.

virtual jint java::lang::Byte::intValue (  )  const [virtual]

Returns the value of this Byte as an int.

Returns:
the int value represented by this object.

Implements java::lang::Number.

virtual jlong java::lang::Byte::longValue (  )  const [virtual]

Returns the value of this Byte as a long.

Returns:
the byte value represented by this object that is converted to type long and the result of the conversion is returned.

Implements java::lang::Number.

virtual jfloat java::lang::Byte::floatValue (  )  const [virtual]

Returns the value of this Byte as a float.

Returns:
the byte value represented by this object is converted to type float and the result of the conversion is returned.

Implements java::lang::Number.

virtual jdouble java::lang::Byte::doubleValue (  )  const [virtual]

Returns the value of this Byte as a double.

Returns:
the byte value represented by this object is converted to type double and the result of the conversion is returned.

Implements java::lang::Number.

virtual jboolean java::lang::Byte::equals ( const Object src  )  const [virtual]

Compares this object to the specified object.

Parameters:
obj the object to compare with
Returns:
true if the objects are the same; false otherwise.

Reimplemented from java::lang::Object.

virtual jint java::lang::Byte::hashCode (  )  const [virtual]

Returns a hashcode for this Byte.

Reimplemented from java::lang::Object.

virtual jint java::lang::Byte::compareTo ( const Object src  )  const [virtual]

Compares this Byte to another Object.

If the Object is a Byte, this function behaves like compareTo(Byte). Otherwise, it throws a ClassCastException (as Bytes are comparable only to other Bytes).

Parameters:
o the Object to be compared.
Returns:
the value 0 if the argument is a Byte numerically equal to this Byte; a value less than 0 if the argument is a Byte numerically greater than this Byte; and a value greater than 0 if the argument is a Byte numerically less than this Byte.
Exceptions:
<code>ClassCastException</code> if the argument is not a Byte.
See also:
java.lang.Comparable
Since:
1.2

Reimplemented from java::lang::Comparable.

String java::lang::Byte::toString (  )  const [virtual]

Returns a String object representing this Byte's value.

Reimplemented from java::lang::Object.


Member Data Documentation

const jbyte java::lang::Byte::MIN_VALUE [static]

The smallest value of type byte.

The constant value of this field is -128.

const jbyte java::lang::Byte::MAX_VALUE [static]

The largest value of type byte.

The constant value of this field is 127.


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