Short (Java Card API, Connected Edition)
Date: 2009-12-11

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## java.lang
Class Short

    java.lang.Object
      java.lang.Short

    @TransactionType(value=NOT_SUPPORTED)
    public final class Short

extends Object

The Short class is the standard wrapper for short values.

Instances of the Short class are not bound to any context and can be passed between contexts without any restrictions. Objects created and returned by the methods of this class are owned by the caller. In particular, a call to the `toString()` returns a String instance bound to the owner context of the caller.

See Runtime Environment Specification for the Java Card Platform, Connected Edition, chapter 7 for details regarding transfer of ownership.

Since:
  JDK1.1, CLDC 1.0, Java Card 3.0

Field Summary
`static short` | `MAX_VALUE` The maximum value a Short can have.
`static short` | `MIN_VALUE` The minimum value a Short can have.

Constructor Summary
`Short(short value)` Constructs a Short object initialized to the specified short value.

Method Summary
`boolean` | `equals(Object obj)` Compares this object to the specified object.
`int` | `hashCode()` Returns a hashcode for this Short.
`static short` | `parseShort(String s)` Assuming the specified String represents a short, returns that short's value.
`static short` | `parseShort(String s, int radix)` Assuming the specified String represents a short, returns that short's value in the radix specified by the second argument.
`short` | `shortValue()` Returns the value of this Short as a short.
`String` | `toString()` Returns a String object representing this Short's value.
`static Short` | `valueOf(short value)` Returns a `Short` instance representing the specified `short` value.

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### MIN_VALUE

    public static final short MIN_VALUE

  The minimum value a Short can have.

  See Also:
    Constant Field Values

### MAX_VALUE

    public static final short MAX_VALUE

  The maximum value a Short can have.

  See Also:
    Constant Field Values

Constructor Detail

### Short

    public Short(short value)

  Constructs a Short object initialized to the specified short value.

  Parameters:
    `value` - the initial value of the Short

Method Detail

### 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
  Returns:
    The short value represented by the specified string
  Throws:
    `NumberFormatException` - If the string does not contain a parsable short.

### parseShort

    public static short parseShort(String s,
                                   int radix)
                            throws NumberFormatException

  Assuming the specified String represents a short, returns that short's value in the radix specified by the second argument. 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
  Returns:
    The short value represented by the specified string in the specified radix.
  Throws:
    `NumberFormatException` - If the String does not contain a parsable short.

### shortValue

    public short shortValue()

  Returns the value of this Short as a short.

  Returns:
    the value of this Short as a short.

### toString

    public String toString()

  Returns a String object representing this Short's value.

  Overrides:
    `toString` in class `Object`
  Returns:
    a string representation of the object.

### hashCode

    public int hashCode()

  Returns a hashcode for this Short.

  Overrides:
    `hashCode` in class `Object`
  Returns:
    a hash code value for this object.
  See Also:
    `Object.equals(java.lang.Object)`, `Hashtable`

### equals

    public boolean equals(Object obj)

  Compares this object to the specified object.

  Overrides:
    `equals` in class `Object`
  Parameters:
    `obj` - the object to compare with
  Returns:
    true if the objects are the same; false otherwise.
  See Also:
    `Boolean.hashCode()`, `Hashtable`

### valueOf

    public static Short valueOf(short value)

  Returns a `Short` instance representing the specified `short` value. If a new `Short` instance is not required, this method should generally be used in preference to the constructor `Short(short)`, as this method is likely to yield significantly better space and time performance by caching frequently requested values.

  Parameters:
    `value` - a short value.
  Returns:
    a `Short` instance representing `value`.
  Since:
    JDK 1.5, Java Card 3.0

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.