java::lang::Short Class Reference

Inheritance diagram for java::lang::Short:

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

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

List of all members.


Detailed Description

The Short class is the standard wrapper for short values.

Author:
Nakul Saraiya
Version:
1.22, 02/02/00
See also:
java.lang.Number
Since:
JDK1.1

Public Member Functions

 Short (jshort _value=0)
 Constructs a Short object initialized to the specified short value.
 operator jshort & ()
virtual jbyte byteValue () const
 Returns the value of this Short as a byte.
virtual jshort shortValue () const
 Returns the value of this Short as a short.
virtual jint intValue () const
 Returns the value of this Short as an int.
virtual jlong longValue () const
 Returns the value of this Short as a long.
virtual jfloat floatValue () const
 Returns the value of this Short as a float.
virtual jdouble doubleValue () const
 Returns the value of this Short 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 Short.
virtual jint compareTo (const Object &src) const
 Compares this Short to another Object.
virtual String toString () const
 Returns a String object representing this Short's value.

Static Public Member Functions

static jshort parseShort (const String &s, jint radix=10)
 Assuming the specified String represents a short, returns that short's value.
static const Short valueOf (const String &s, jint radix=10)
 Assuming the specified String represents a short, returns a new Short object initialized to that value.

Static Public Attributes

static const jshort MIN_VALUE
 The minimum value a Short can have.
static const jshort MAX_VALUE
 The maximum value a Short can have.

Constructor & Destructor Documentation

java::lang::Short::Short ( jshort  _value = 0  ) 

Constructs a Short object initialized to the specified short value.

Parameters:
value the initial value of the Short


Member Function Documentation

static jshort java::lang::Short::parseShort ( const String s,
jint  radix = 10 
) [static]

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

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

Parameters:
s the String containing the short
radix the radix to be used
Returns:
The short value represented by the specified string in the specified radix.
Exceptions:
NumberFormatException If the String does not contain a parsable short.

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

Assuming the specified String represents a short, returns a new Short object initialized to that value.

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

Parameters:
s the String containing the integer
radix the radix to be used
Returns:
The Short value represented by the specified string in the specified radix.
Exceptions:
NumberFormatException If the String does not contain a parsable short.

java::lang::Short::operator jshort & (  ) 

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

Returns the value of this Short as a byte.

Since:
JDK1.1

Reimplemented from java::lang::Number.

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

Returns the value of this Short as a short.

Since:
JDK1.1

Reimplemented from java::lang::Number.

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

Returns the value of this Short as an int.

Returns:
the int value represented by this object.

Implements java::lang::Number.

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

Returns the value of this Short 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::Short::floatValue (  )  const [virtual]

Returns the value of this Short 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::Short::doubleValue (  )  const [virtual]

Returns the value of this Short 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::Short::equals ( const Object src  )  const [virtual]

Compares this object to the specified object.

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

Reimplemented from java::lang::Object.

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

Returns a hashcode for this Short.

Reimplemented from java::lang::Object.

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

Compares this Short to another Object.

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

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

Reimplemented from java::lang::Comparable.

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

Returns a String object representing this Short's value.

Reimplemented from java::lang::Object.


Member Data Documentation

const jshort java::lang::Short::MIN_VALUE [static]

The minimum value a Short can have.

const jshort java::lang::Short::MAX_VALUE [static]

The maximum value a Short can have.


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