java.lang
Class Short

java.lang.Object
  extended by java.lang.Short

public final class Short
extends Object

The Short class is the standard wrapper for short values.


Field Summary
static short MAX_VALUE
          The maximum value a Short can have.
static short MIN_VALUE
          The minimum value a Short can have.
 
Constructor Summary
Short(short value)
          Constructs a Short object initialized to the specified short value
 
Method Summary
 boolean equals(Object obj)
          Compares this object to the specified object.
 int hashCode()
          Returns a hashcode for this Short.
static short parseShort(String s)
          Assuming the specified String represents a short, returns that short's value.
static short parseShort(String s, int radix)
          Assuming the specified String represents a short, returns that short's value in the radix specified by the second argument.
 short shortValue()
          Returns the value of this Short as a short.
 String toString()
          Returns a String object representing this Short's value.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_VALUE

public static final short MIN_VALUE
The minimum value a Short can have.

See Also:
Constant Field Values

MAX_VALUE

public static final short MAX_VALUE
The maximum value a Short can have.

See Also:
Constant Field Values
Constructor Detail

Short

public Short(short value)
Constructs a Short object initialized to the specified short value

Method Detail

equals

public boolean equals(Object obj)
Compares this object to the specified object.

Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

hashCode

public int hashCode()
Returns a hashcode for this Short.

Overrides:
hashCode in class Object

parseShort

public static short parseShort(String s)
                        throws NumberFormatException
Assuming the specified String represents a short, returns that short's value. Throws an exception if the String cannot be parsed as a short. The radix is assumed to be 10.

Throws:
NumberFormatException

parseShort

public static short parseShort(String s,
                               int radix)
                        throws NumberFormatException
Assuming the specified String represents a short, returns that short's value in the radix specified by the second argument. Throws an exception if the String cannot be parsed as a short.

Throws:
NumberFormatException

shortValue

public short shortValue()
Returns the value of this Short as a short.


toString

public String toString()
Returns a String object representing this Short's value.

Overrides:
toString in class Object