|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--java.lang.Number | +--java.lang.Short
Short クラスは short 値の標準ラッパーです。
Number
, 直列化された形式フィールドの概要 | |
static short |
MAX_VALUE
Short が持つことのできる最大値です。 |
static short |
MIN_VALUE
Short が持つことのできる最小値です。 |
static Class |
TYPE
基本データ型 short を表す Class オブジェクトです。 |
コンストラクタの概要 | |
Short(short value)
指定された short 値に初期化された Short オブジェクト構築します。 |
|
Short(String s)
String パラメータによって指定された値に初期化された Short オブジェクト構築します。 |
メソッドの概要 | |
byte |
byteValue()
この Short の値を byte として返します。 |
int |
compareTo(Object o)
この Short をほかの Object と比較します。 |
int |
compareTo(Short anotherShort)
2 つの Short を数値的に比較します。 |
static Short |
decode(String nm)
String を Short に復号化します。 |
double |
doubleValue()
この Short の値を double として返します。 |
boolean |
equals(Object obj)
このオブジェクトを指定されたオブジェクトと比較します。 |
float |
floatValue()
この Short の値を float として返します。 |
int |
hashCode()
この Short のハッシュコードを返します。 |
int |
intValue()
この Short の値を int として返します。 |
long |
longValue()
この Short の値を long として返します。 |
static short |
parseShort(String s)
指定された文字列が short を表すと仮定して、その short 値を返します。 |
static short |
parseShort(String s,
int radix)
指定された文字列が short を表すと仮定して、その short 値を返します。 |
short |
shortValue()
この Short の値を short として返します。 |
String |
toString()
この Short の値を表す String オブジェクトを返します。 |
static String |
toString(short s)
指定された Short を表す新しい String オブジェクトを返します。 |
static Short |
valueOf(String s)
指定された文字列が short を表すと仮定して、その値に初期化した新しい Short オブジェクトを返します。 |
static Short |
valueOf(String s,
int radix)
指定された文字列が short を表すと仮定して、その値で初期化された新しい Short オブジェクトを返します。 |
クラス java.lang.Object から継承したメソッド |
clone,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
フィールドの詳細 |
public static final short MIN_VALUE
public static final short MAX_VALUE
public static final Class TYPE
コンストラクタの詳細 |
public Short(short value)
value
- Short の初期値public Short(String s) throws NumberFormatException
s
- Short に変換される Stringメソッドの詳細 |
public static String toString(short s)
s
- 変換対象の shortpublic static short parseShort(String s) throws NumberFormatException
s
- short を含む文字列public static short parseShort(String s, int radix) throws NumberFormatException
s
- short を含む文字列radix
- 使用される基数public static Short valueOf(String s, int radix) throws NumberFormatException
s
- 整数型を含む文字列radix
- 使用される基数public static Short valueOf(String s) throws NumberFormatException
s
- 整数型を含む文字列public static Short decode(String nm) throws NumberFormatException
String
を Short
に復号化します。次の形式の 10 進数、8 進数、16 進数を指定することができます。
[-]オプションの負の符号または「基数指定子」のあとの定数は、指定された基数 (10、8 または 16) を使って[-] 0x [-] # [-] 0
Short.parseShort
メソッドの場合と同じように解析されます。この定数は正の値でなければなりません。そうでない場合は NumberFormatException がスローされます。指定された String
の最初の文字が負の符号の場合、結果は負の値になります。String
に空白文字を指定することはできません。nm
- 復号化対象の String
Short
String
が解析可能な short を含まない場合parseShort(String, int)
public byte byteValue()
public short shortValue()
public int intValue()
public long longValue()
public float floatValue()
public double doubleValue()
public String toString()
public int hashCode()
public boolean equals(Object obj)
obj
- 比較対象のオブジェクトpublic int compareTo(Short anotherShort)
anotherShort
- 比較対象の Short
0
。この Short が Short 引数より小さい数値の場合は 0
より小さい値。この Short が Short 引数より大きい数値の場合は 0
より大きい値 (符号付きの比較)public int compareTo(Object o)
compareTo(Short)
と同じです。そうでない場合は ClassCastException
がスローされます。これは、Short の比較は Short 同士でしか行えないためです。o
- 比較対象の Object
0
。引数がこの Short より大きい数値の場合は 0
より小さい値。引数がこの Short より小さい数値の場合は 0
より大きい値ClassCastException
- 引数が Short
でない場合Comparable
|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |