Short

The {@code Short} class wraps a value of primitive type {@code short} in an object. An object of type {@code Short} contains a single field whose type is {@code short}.

<p>In addition, this class provides several methods for converting a {@code short} to a {@code string} and a {@code string} to a {@code short}, as well as other constants and methods useful when dealing with a {@code short}.

@author Nakul Saraiya @author Joseph D. Darcy @see java.lang.Number

Constructors

this
this(short value)

Constructs a newly allocated {@code Short} object that represents the specified {@code short} value.

this
this(int value)
Undocumented in source.

Members

Functions

toHash
size_t toHash()

Returns a hash code for this {@code Short}; equal to the result of invoking {@code intValue()}.

Static functions

parseShort
short parseShort(string s)
Undocumented in source. Be warned that the author may not have intended to support it.
reverseBytes
short reverseBytes(short i)

Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified {@code short} value.

toString
string toString(short s)

Returns a new {@code string} object representing the specified {@code short}. The radix is assumed to be 10.

toUnsignedInt
int toUnsignedInt(short x)

Converts the argument to an {@code int} by an unsigned conversion. In an unsigned conversion to an {@code int}, the high-order 16 bits of the {@code int} are zero and the low-order 16 bits are equal to the bits of the {@code short} argument.

toUnsignedLong
long toUnsignedLong(short x)

Converts the argument to a {@code long} by an unsigned conversion. In an unsigned conversion to a {@code long}, the high-order 48 bits of the {@code long} are zero and the low-order 16 bits are equal to the bits of the {@code short} argument.

Variables

BYTES
enum int BYTES;

The number of bytes used to represent a {@code short} value in two's complement binary form.

MAX_VALUE
enum short MAX_VALUE;

A constant holding the maximum value a {@code short} can have, 2<sup>15</sup>-1.

MIN_VALUE
enum short MIN_VALUE;

A constant holding the minimum value a {@code short} can have, -2<sup>15</sup>.

SIZE
enum int SIZE;

The number of bits used to represent a {@code short} value in two's complement binary form.

Meta