当前页面: 
在线文档首页 > 
JDK 5 Documentation v1.1.8, Java 2 SDK 英文文档
Class java.lang.Short - JDK 5 Documentation v1.1.8, Java 2 SDK 英文文档
All Packages  Class Hierarchy  This Package  Previous  Next  Index
  Class java.lang.Short
java.lang.Object
   |
   +----java.lang.Number
           |
           +----java.lang.Short
  -  public final class Short
  -  extends Number
The Short class is the standard wrapper for short values.
    -  See Also:
    
-  Number
   
  -   MAX_VALUE MAX_VALUE
-   The maximum value a Short can have.
  
-   MIN_VALUE MIN_VALUE
-   The minimum value a Short can have.
  
-   TYPE TYPE
-   The Class object representing the primitive type short.
   
  -   Short(short) Short(short)
-   Constructs a Short object initialized to the specified short value.
  
-   Short(String) Short(String)
-   Constructs a Short object initialized to the value specified by the
 String parameter.
   
  -   byteValue() byteValue()
-   Returns the value of this Short as a byte.
  
-   decode(String) decode(String)
-   Decodes a String into a Short.
  
-   doubleValue() doubleValue()
-   Returns the value of this Short as a double.
  
-   equals(Object) equals(Object)
-   Compares this object to the specified object.
  
-   floatValue() floatValue()
-   Returns the value of this Short as a float.
  
-   hashCode() hashCode()
-   Returns a hashcode for this Short.
  
-   intValue() intValue()
-   Returns the value of this Short as an int.
  
-   longValue() longValue()
-   Returns the value of this Short as a long.
  
-   parseShort(String) parseShort(String)
-   Assuming the specified String represents a short, returns
 that short's value.
  
-   parseShort(String, int) parseShort(String, int)
-   Assuming the specified String represents a short, returns
 that short's value.
  
-   shortValue() shortValue()
-   Returns the value of this Short as a short.
  
-   toString() toString()
-   Returns a String object representing this Short's value.
  
-   toString(short) toString(short)
-   Returns a new String object representing the specified
 Short.
  
-   valueOf(String) valueOf(String)
-   Assuming the specified String represents a short, returns a
 new Short object initialized to that value.
  
-   valueOf(String, int) valueOf(String, int)
-   Assuming the specified String represents a short, returns a
 new Short object initialized to that value.
   
 MIN_VALUE
MIN_VALUE
 public static final short MIN_VALUE
  -  The minimum value a Short can have.
 
 MAX_VALUE
MAX_VALUE
 public static final short MAX_VALUE
  -  The maximum value a Short can have.
 
 TYPE
TYPE
 public static final Class TYPE
  -  The Class object representing the primitive type short.
 
   
 Short
Short
 public Short(short value)
  -  Constructs a Short object initialized to the specified short value.
   
- 
    -  Parameters:
    
-  value - the initial value of the Short
  
 
 Short
Short
 public Short(String s) throws NumberFormatException
  -  Constructs a Short object initialized to the value specified by the
 String parameter.  The radix is assumed to be 10.
   
- 
    -  Parameters:
    
-  s - the String to be converted to a Short
    
-  Throws: NumberFormatException
    
-  If the String does not
			contain a parsable short.
  
 
   
 toString
toString
 public static String toString(short s)
  -  Returns a new String object representing the specified
 Short. The radix is assumed to be 10.
   
- 
    -  Parameters:
    
-  s - the short to be converted
  
 
 parseShort
parseShort
 public static short parseShort(String s) throws NumberFormatException
  -  Assuming the specified String represents a short, returns
 that short's value. Throws an exception if the String cannot
 be parsed as a short.  The radix is assumed to be 10.
   
- 
    -  Parameters:
    
-  s - the String containing the short
    
-  Throws: NumberFormatException
    
-  If the string does not
			contain a parsable short.
  
 
 parseShort
parseShort
 public static short parseShort(String s,
                                int radix) throws NumberFormatException
  -  Assuming the specified String represents a short, returns
 that short's value. Throws an exception if the String cannot
 be parsed as a short.
   
- 
    -  Parameters:
    
-  s - the String containing the short
    -  radix - the radix to be used
    
-  Throws: NumberFormatException
    
-  If the String does not
			contain a parsable short.
  
 
 valueOf
valueOf
 public static Short valueOf(String s,
                             int radix) throws NumberFormatException
  -  Assuming the specified String represents a short, returns a
 new Short object initialized to that value.  Throws an
 exception if the String cannot be parsed as a short.
   
- 
    -  Parameters:
    
-  s - the String containing the integer
    -  radix - the radix to be used
    
-  Throws: NumberFormatException
    
-  If the String does not
			contain a parsable short.
  
 
 valueOf
valueOf
 public static Short valueOf(String s) throws NumberFormatException
  -  Assuming the specified String represents a short, returns a
 new Short object initialized to that value.  Throws an
 exception if the String cannot be parsed as a short.
   
- 
    -  Parameters:
    
-  s - the String containing the integer
    
-  Throws: NumberFormatException
    
-  If the String does not
			contain a parsable short.
  
 
 decode
decode
 public static Short decode(String nm) throws NumberFormatException
  -  Decodes a String into a Short.  The String may represent
 decimal, hexadecimal, and octal numbers.
   
- 
    -  Parameters:
    
-  nm - the string to decode
  
 
 byteValue
byteValue
 public byte byteValue()
  -  Returns the value of this Short as a byte.
   
- 
    -  Overrides:
    
-  byteValue in class Number
  
 
 shortValue
shortValue
 public short shortValue()
  -  Returns the value of this Short as a short.
   
- 
    -  Overrides:
    
-  shortValue in class Number
  
 
 intValue
intValue
 public int intValue()
  -  Returns the value of this Short as an int.
   
- 
    -  Overrides:
    
-  intValue in class Number
  
 
 longValue
longValue
 public long longValue()
  -  Returns the value of this Short as a long.
   
- 
    -  Overrides:
    
-  longValue in class Number
  
 
 floatValue
floatValue
 public float floatValue()
  -  Returns the value of this Short as a float.
   
- 
    -  Overrides:
    
-  floatValue in class Number
  
 
 doubleValue
doubleValue
 public double doubleValue()
  -  Returns the value of this Short as a double.
   
- 
    -  Overrides:
    
-  doubleValue in class Number
  
 
 toString
toString
 public String toString()
  -  Returns a String object representing this Short's value.
   
- 
    -  Overrides:
    
-  toString in class Object
  
 
 hashCode
hashCode
 public int hashCode()
  -  Returns a hashcode for this Short.
   
- 
    -  Overrides:
    
-  hashCode in class Object
  
 
 equals
equals
 public boolean equals(Object obj)
  -  Compares this object to the specified object.
   
- 
    -  Parameters:
    
-  obj - the object to compare with
    
-  Returns:
    
-  true if the objects are the same; false otherwise.
    
-  Overrides:
    
-  equals in class Object
  
 
All Packages  Class Hierarchy  This Package  Previous  Next  Index
Submit a bug or feature - Version 1.1.8 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems,  Inc. in the US and other countries.
Copyright 1995-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A.  All Rights Reserved.