|
![]() |
|||||||||
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 provides a class for short values stored in objects.
Field Summary | |
---|---|
static short |
MAX_VALUE
The largest value a short can hold. |
static short |
MIN_VALUE
The smallest value a short can hold. |
static int |
SIZE
The size occupied by one short in bits. |
static Class<Short> |
TYPE
type for short. |
Constructor Summary | |
---|---|
Short(short value)
Constructor to create an instance of Short with the given short value. |
|
Short(String s)
Constructor to create an instance of Short with the value provided as a string. |
Method Summary | |
---|---|
byte |
byteValue()
byteValue returns the value of this as a byte. |
int |
compareTo(Short o)
compareTo compares this to another short value |
static Short |
decode(String nm)
decode parses a short given as a decimal, octal or hex number. |
double |
doubleValue()
doubleValue returns the value of this as a double. |
boolean |
equals(Object obj)
equals checks if this and obj represent the same value. |
float |
floatValue()
floatValue returns the value of this as a float. |
int |
hashCode()
hashCode returns a hashCode for this Short. |
int |
intValue()
intValue returns the value of this as an int. |
long |
longValue()
longValue returns the value of this as a long. |
static short |
parseShort(String s)
parseShort parses a string that contains the decimal representation of a short and returns the short's value. |
static short |
parseShort(String s,
int radix)
parseShort parses a string that contains a short represented by a number using the given radix. |
static short |
reverseBytes(short s)
reverseBytes returns a short with reversed bytes of s. |
short |
shortValue()
shortValue returns the value of this as a short. |
String |
toString()
toString converts the value of this int to a decimal string. |
static String |
toString(short s)
toString creates a decimal string from the given short value. |
static Short |
valueOf(short s)
valueOf returns a short instance with the given value. |
static Short |
valueOf(String s)
valueOf returns a short instance with the value given as a decimal string. |
static Short |
valueOf(String s,
int radix)
valueOf returns a short instance with the value given as a string with given radix. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final short MIN_VALUE
public static final short MAX_VALUE
public static final int SIZE
public static final Class<Short> TYPE
Constructor Detail |
---|
public Short(short value)
value
- the value for this instance.public Short(String s) throws NumberFormatException
s
- the string representation of the value.
NumberFormatException
- if s could not be parsed as a short.Method Detail |
---|
public static String toString(short s)
s
- the short value
public static short parseShort(String s) throws NumberFormatException
s
- the string, e.g, "-128", "3", "127".
NumberFormatException
- if s is not parsable or out of
the legal range for shorts.public static short parseShort(String s, int radix) throws NumberFormatException
s
- the stringradix
- the radix
NumberFormatException
- if s is not parsable, radix is
out of the legal range or the value is out of the legal range
for shorts.public static Short valueOf(String s, int radix) throws NumberFormatException
s
- the stringradix
- the radix
NumberFormatException
- if s is not parsable, radix is out
of the legal range or the value is out of the legal range for
shorts.public static Short valueOf(String s) throws NumberFormatException
s
- the string, e.g, "-128", "3", "127".
NumberFormatException
- if s is not parsable or the value
is out of the legal range for shorts.public static Short decode(String nm) throws NumberFormatException
nm
- the short value as a string
NumberFormatException
- if parsing failed or the resulting
value is not representable as a short.public byte byteValue()
byteValue
in class Number
public short shortValue()
shortValue
in class Number
public int intValue()
intValue
in class Number
public long longValue()
longValue
in class Number
public float floatValue()
floatValue
in class Number
public double doubleValue()
doubleValue
in class Number
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
- another object
public int compareTo(Short o)
compareTo
in interface Comparable<Short>
o
- the other short
public static Short valueOf(short s)
s
- the short value
public static short reverseBytes(short s)
s
- the short value
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |