|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Number
java.lang.Short
public final class Short
Short is the wrapper for the primitive type short.
Number,
Serialized Form| Nested Class Summary | |
|---|---|
(package private) static class |
Short.valueOfCache
|
| Field Summary | |
|---|---|
static short |
MAX_VALUE
Constant for the maximum short value, 215-1. |
static short |
MIN_VALUE
Constant for the minimum short value, -215. |
static int |
SIZE
Constant for the number of bits to represent a short in
two's compliment form. |
static Class<Short> |
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()
Returns the byte value which the receiver represents |
int |
compareTo(Short object)
Compares this Short to the Short
passed. |
static Short |
decode(String string)
Parses the string argument as if it was a short value and returns the result. |
double |
doubleValue()
Returns the double value which the receiver represents |
boolean |
equals(Object object)
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. |
float |
floatValue()
Returns the float value which the receiver represents |
int |
hashCode()
Returns an integer hash code for the receiver. |
int |
intValue()
Returns the int value which the receiver represents |
long |
longValue()
Returns 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. |
static short |
reverseBytes(short s)
Reverses the bytes of a short. |
short |
shortValue()
Returns the short value which the receiver represents |
String |
toString()
Returns a string containing a concise, human-readable description of the receiver. |
static String |
toString(short value)
Returns a string containing a concise, human-readable description of the argument. |
static Short |
valueOf(short s)
Returns a Short instance for the short
value passed. |
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
Constant for the maximum short value, 215-1.
public static final short MIN_VALUE
Constant for the minimum short value, -215.
public static final int SIZE
Constant for the number of bits to represent a short in
two's compliment form.
public static final Class<Short> 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(Short object)
Compares this Short to the Short
passed. If this instance's value is equal to the value of the instance
passed, then 0 is returned. If this instance's value is less than the
value of the instance passed, then a negative value is returned. If this
instance's value is greater than the value of the instance passed, then a
positive value is returned.
compareTo in interface Comparable<Short>object - The instance to compare to.
NullPointerException - if object is
null.
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 Number
public 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.public static short reverseBytes(short s)
Reverses the bytes of a short.
s - The short to reverse.
public static Short valueOf(short s)
Returns a Short instance for the short
value passed. This method is preferred over the constructor, as this
method may maintain a cache of instances.
s - The short value.
Short instance.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||