当前位置 类层次 (JDK) 所有类 (JDK) 所有域和方法 (JDK)

类 java.lang.Short

java.lang.Object
   |
   +----java.lang.Number
           |
           +----java.lang.Short

public final class Short
extends Number

Short 类是 short 数据的标准包装类。

出现于:
JDK1.1
参见:
Number

变量索引

MAX_VALUE
一个 Short 对象可取的最大值。
MIN_VALUE
一个 Short 对象可取的最小值。
TYPE
描述基本 Short 型的类对象。

构造子索引

Short(short)
创建一个初始为指定 short 值的 short 对象。
Short(String)
创建一个 short 对象,用 String 参数指定的值初始化。

方法索引

byteValue()
以short的形式返回 Short 对象的值。
decode(String)
将一个字符串译码为一个 short 对象。
doubleValue()
返回该 Short 的值,以 double 类型表示。
equals(Object)
比较该对象和指定对象。
floatValue()
返回该 Short 的值,以 float 类型表示。
hashCode()
返回该 Short 的散列码。
intValue()
返回该 Short 的值,以 int 类型表示。
longValue()
以长整型返回 Short 对象的值。
parseShort(String)
假设指定的字符串表示一个 short ,返回此 short 的值。
parseShort(String, int)
假设指定的字符串表示一个 short 对象,返回此 short 对象值。
shortValue()
返回该 Short 的值,以 short 类型表示。
toString()
返回表示此 short 值的字符串对象。
toString(short)
返回表示指定 short 对象对应的一个新的字符串对象。
valueOf(String)
假设指定的串表示一个 short 型,返回初始化为该值的新的 short 对象。
valueOf(String, int)
假设指定的串表示一个 short 型,返回初始化为该值的新的 short 对象。

变量

MIN_VALUE
 public static final short MIN_VALUE
一个 Short 对象可取的最小值。

MAX_VALUE
 public static final short MAX_VALUE
一个 Short 对象可取的最大值。

TYPE
 public static final Class TYPE
描述基本 Short 型的类对象。


构造子

Short
 public Short(short value)
创建一个初始为指定 short 值的 short 对象。

参数:
value - short对象的初始值
Short
 public Short(String s) throws NumberFormatException
创建一个 short 对象,用 String 参数指定的值初始化。 假定用 10 进制表示。

参数:
s - 待转换为 short 对象的串
抛出: NumberFormatException
若字符串不包含可分析的 short 型。

方法

toString
 public static String toString(short s)
返回表示指定 short 对象的一个新的字符串对象。假定用 10 进制表示。

参数:
s - 待转换的 short 型
parseShort
 public static short parseShort(String s) throws NumberFormatException
假设指定的字符串表示一个 short ,返回此 short 对象的值。 如果该串不能以 short分析,则抛出异常。假定用 10 进制表示。

参数:
s - 包含short的串
抛出: NumberFormatException
若字符串不包含可分析的 Short 型。
parseShort
 public static short parseShort(String s,
                            int radix) throws NumberFormatException
假设指定的字符串表示一个 short 对象,返回此 short 对象值。 如果该串不能以short分析,则抛出异常。

参数:
s - 包含short的串
radix - 使用的进制
抛出: NumberFormatException
若字符串不包含可分析的 short 型。
valueOf
 public static Short valueOf(String s,
                            int radix) throws NumberFormatException
假设指定的串表示一个 short 型,返回初始化为该值的新的 short 对象。 如果该串不能以 short 分析,则抛出异常。

参数:
s - 包含整数的串
radix - 使用的进制
抛出: NumberFormatException
若字符串不包含可分析的 short 型。
valueOf
 public static Short valueOf(String s) throws NumberFormatException
假设指定的串表示一个 short 型,返回初始化为该值的新的 short 对象。如果该串不能以 short 分析,则抛出异常。

参数:
s - 包含整数的串
抛出: NumberFormatException
若字符串不包含可分析的 short 型。
decode
 public static Short decode(String nm) throws NumberFormatException
将一个字符串译码为一个 short 对象。该串可以表示十进制、十六进制和八进制数。

参数:
nm - 待译码的串
byteValue
 public byte byteValue()
以 byte 的形式返回 Short 对象的值。

覆盖:
Number 中的 byteValue
shortValue
 public short shortValue()
返回该 Short 的值,以 short 类型表示。

覆盖:
Number 中的 shortValue
intValue
 public int intValue()
返回该 Short 的值,以 int 类型表示。

覆盖:
Number 中的 intValue
longValue
 public long longValue()
以 long 型返回 Short 对象的值。

覆盖:
Number 中的 longValue
floatValue
 public float floatValue()
返回该 Short 的值,以 float 类型表示。

覆盖:
Number 中的 floatValue
doubleValue
 public double doubleValue()
返回该 Short 的值,以 double 类型表示。

覆盖:
Number 中的 doubleValue
toString
 public String toString()
返回表示此 short 值的字符串对象。

覆盖:
Object 中的 toString
hashCode
 public int hashCode()
返回该 Short 的散列码。

覆盖:
Object 中的 hashCode
equals
 public boolean equals(Object obj)
比较该对象和指定对象。

参数:
obj - 比较的对象。
返回:
如果是相同对象则为 true ,否则为 false 。
覆盖:
等于在类中Object

当前位置 类层次(JDK) 所有类(JDK) 所有域和方法(JDK)