|
Final | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectjava.lang.Number
java.lang.Short
Shorts are objects (non-base types) which represent short values.
| Field Summary | |
|---|---|
static short |
MAX_VALUE
Most positive and most negative possible short values. |
static short |
MIN_VALUE
|
static Class |
TYPE
The java.lang.Class that represents this class. |
| Constructor Summary | |
|---|---|
Short(short value)
Constructs a new instance of the receiver which represents the short valued argument. |
|
Short(String string)
Constructs a new instance of this class given a string. |
|
| Method Summary | |
|---|---|
byte |
byteValue()
Answers the byte value which the receiver represents |
int |
compareTo(Object object)
Answers an integer indicating the relative positions of the receiver and the argument in the natural order of elements of the receiver's class. |
int |
compareTo(Short object)
|
static Short |
decode(String string)
Parses the string argument as if it was a short value and returns the result. |
double |
doubleValue()
Answers the double value which the receiver represents |
boolean |
equals(Object object)
Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison. |
float |
floatValue()
Answers the float value which the receiver represents |
int |
hashCode()
Answers an integer hash code for the receiver. |
int |
intValue()
Answers the int value which the receiver represents |
long |
longValue()
Answers the long value which the receiver represents |
static short |
parseShort(String string)
Parses the string argument as if it was a short value and returns the result. |
static short |
parseShort(String string,
int radix)
Parses the string argument as if it was a short value and returns the result. |
short |
shortValue()
Answers the short value which the receiver represents |
String |
toString()
Answers a string containing a concise, human-readable description of the receiver. |
static String |
toString(short value)
Answers a string containing a concise, human-readable description of the argument. |
static Short |
valueOf(String string)
Parses the string argument as if it was a short value and returns a Short representing the result. |
static Short |
valueOf(String string,
int radix)
Parses the string argument as if it was a short value and returns a Short representing the result. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final short MAX_VALUE
public static final short MIN_VALUE
public static final Class TYPE
| Constructor Detail |
public Short(String string)
throws NumberFormatException
string - a string representation of a
short quantity.
NumberFormatException - if the argument could not be parsed
as a short quantity.public Short(short value)
value - the short to store in the new instance.| Method Detail |
public byte byteValue()
byteValue in class Numberpublic int compareTo(Object object)
Comparable
compareTo in interface Comparableobject - Object
an object to compare the receiver to
public int compareTo(Short object)
public static Short decode(String string)
throws NumberFormatException
string - a string representation of a
short quantity.
NumberFormatException - if the argument could not be parsed
as a short quantity.public double doubleValue()
doubleValue in class Numberpublic boolean equals(Object object)
In this case, the argument must also be a Short, and the receiver and argument must represent the same short value.
equals in class Objectobject - the object to compare with this object
true
if the object is the same as this object
false
if it is different from this objecthashCode()public float floatValue()
floatValue in class Numberpublic int hashCode()
true when passed to
equals must answer the same value for this
method.
hashCode in class Objectequals(java.lang.Object)public int intValue()
intValue in class Numberpublic long longValue()
longValue in class Numberpublic static short parseShort(String string)
throws NumberFormatException
string - a string representation of a
short quantity.
NumberFormatException - if the argument could not be parsed
as a short quantity.public static short parseShort(String string,
int radix)
throws NumberFormatException
string - a string representation of a short quantity.radix - the radix to use when parsing.
NumberFormatException - if the argument could not be parsed
as a short quantity.public short shortValue()
shortValue in class Numberpublic String toString()
toString in class Objectpublic static String toString(short value)
value - short
the short to convert.
public static Short valueOf(String string)
throws NumberFormatException
string - a string representation of a short quantity.
NumberFormatException - if the argument could not be parsed
as a short quantity.public static Short valueOf(String string,
int radix)
throws NumberFormatException
string - a string representation of a short quantity.radix - the radix to use when parsing.
NumberFormatException - if the argument could not be parsed
as a short quantity.
|
Final | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||