rebuild.util.ref
Class RefUShort

java.lang.Object
  extended by rebuild.util.ref.RefNumber
      extended by rebuild.util.ref.RefUShort

public final class RefUShort
extends RefNumber

Reference UShort is the same as Short but is unsigned and allows you to set the short without creating a new Short.

Since:
BBX 1.1.0

Field Summary
static RefUShort MAX_VALUE
          The maximum value a RefUShort can have.
static short MAX_VALUE_SHORT
          The maximum value a RefUShort can have.
static RefUShort MIN_VALUE
          The minimum value a RefUShort can have.
static short MIN_VALUE_SHORT
          The minimum value a RefUShort can have.
 
Fields inherited from class rebuild.util.ref.RefNumber
_fixed, BIT_SHIFT_LEFT, BIT_SHIFT_LEFT_LOGICAL, BIT_SHIFT_RIGHT, BIT_SHIFT_RIGHT_LOGICAL
 
Constructor Summary
RefUShort()
          Create a new RefUShort set to the default of 0.
RefUShort(short value)
          Create a new RefUShort using a short primitive.
RefUShort(short value, boolean fixed)
          Create a new RefUShort using a short primitive.
 
Method Summary
 RefUShort clone()
          Create a clone of the current object.
 RefNumber cloneNumber()
          Create a clone of the current object.
 int hashCode()
          Returns a hash code for this RefUShort object.
static RefUShort parseUShort(java.lang.String s)
          Assuming the specified String represents a short, returns that short's value.
static RefUShort parseUShort(java.lang.String s, int radix)
          Assuming the specified String represents a short, returns that short's value.
 RefUShort setValue(short value)
          Set the value of this RefUShort object with a short primitive.
 RefUShort setValue(java.lang.Short value)
          Set the value of this RefUShort object with a Short.
 short shortValue()
          Returns The value of this RefUShort object as a short primitive.
 java.lang.String toString()
          Returns a String object representing this RefUShort's value.
 int ushortValue()
          Returns The value of this RefUShort object as a int primitive.
 
Methods inherited from class rebuild.util.ref.RefNumber
add, add, add, add, add, add, add, add, and, and, and, and, and, and, bitShift, bitShift, bitShift, bitShift, bitShift, bitShift, castToByte, castToByte, castToByte, castToByte, castToByte, castToByte, castToByte, castToByte, castToByte, castToDouble, castToDouble, castToDouble, castToDouble, castToDouble, castToDouble, castToDouble, castToDouble, castToDouble, castToFloat, castToFloat, castToFloat, castToFloat, castToFloat, castToFloat, castToFloat, castToFloat, castToFloat, castToInt, castToInt, castToInt, castToInt, castToInt, castToInt, castToInt, castToInt, castToInt, castToLong, castToLong, castToLong, castToLong, castToLong, castToLong, castToLong, castToLong, castToLong, castToShort, castToShort, castToShort, castToShort, castToShort, castToShort, castToShort, castToShort, castToShort, castToUByte, castToUByte, castToUByte, castToUByte, castToUByte, castToUByte, castToUByte, castToUByte, castToUByte, castToUInt, castToUInt, castToUInt, castToUInt, castToUInt, castToUInt, castToUInt, castToUInt, castToUInt, castToULong, castToULong, castToULong, castToULong, castToULong, castToULong, castToULong, castToULong, castToULong, castToUShort, castToUShort, castToUShort, castToUShort, castToUShort, castToUShort, castToUShort, castToUShort, castToUShort, compliment, deincrement, divide, divide, divide, divide, divide, divide, divide, divide, equals, equals, equals, equals, equals, equals, equals, equals, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThanOrEqual, greaterThanOrEqual, greaterThanOrEqual, greaterThanOrEqual, greaterThanOrEqual, greaterThanOrEqual, greaterThanOrEqual, greaterThanOrEqual, increment, isReadOnly, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThanOrEqual, lessThanOrEqual, lessThanOrEqual, lessThanOrEqual, lessThanOrEqual, lessThanOrEqual, lessThanOrEqual, lessThanOrEqual, makeFixed, makeFixed, modulus, modulus, modulus, modulus, modulus, modulus, modulus, modulus, multiply, multiply, multiply, multiply, multiply, multiply, multiply, multiply, notEquals, notEquals, notEquals, notEquals, notEquals, notEquals, notEquals, notEquals, or, or, or, or, or, or, subtract, subtract, subtract, subtract, subtract, subtract, subtract, subtract, xor, xor, xor, xor, xor, xor
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_VALUE_SHORT

public static final short MAX_VALUE_SHORT
The maximum value a RefUShort can have. This is stored as a signed number for simplicity.

See Also:
Constant Field Values

MIN_VALUE_SHORT

public static final short MIN_VALUE_SHORT
The minimum value a RefUShort can have. This is stored as a signed number for simplicity.

See Also:
Constant Field Values

MAX_VALUE

public static final RefUShort MAX_VALUE
The maximum value a RefUShort can have.


MIN_VALUE

public static final RefUShort MIN_VALUE
The minimum value a RefUShort can have.

Constructor Detail

RefUShort

public RefUShort()
Create a new RefUShort set to the default of 0.


RefUShort

public RefUShort(short value)
Create a new RefUShort using a short primitive.

Parameters:
value - The short primitive to set this RefUShort with.

RefUShort

public RefUShort(short value,
                 boolean fixed)
Create a new RefUShort using a short primitive.

Parameters:
value - The short primitive to set this RefUShort with.
fixed - If this item is read only and cannot be modified.
Method Detail

shortValue

public short shortValue()
Returns The value of this RefUShort object as a short primitive.

Returns:
The primitive short value of this object.

ushortValue

public int ushortValue()
Returns The value of this RefUShort object as a int primitive.

Returns:
The primitive int value of this object. This is the only way to return the value unsigned.

setValue

public RefUShort setValue(short value)
Set the value of this RefUShort object with a short primitive.

Parameters:
value - The primitive short value to set this object.
Returns:
This object.

setValue

public RefUShort setValue(java.lang.Short value)
Set the value of this RefUShort object with a Short.

Parameters:
value - The Short value to set this object.
Returns:
This object.

hashCode

public int hashCode()
Returns a hash code for this RefUShort object.

Overrides:
hashCode in class java.lang.Object
Returns:
A hash code value for this object.

toString

public java.lang.String toString()
Returns a String object representing this RefUShort's value.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of the object.

parseUShort

public static RefUShort parseUShort(java.lang.String s)
Assuming the specified String represents a short, returns that short's value.

Parameters:
s - The String containing the short.
Returns:
The parsed value of the short.
Throws:
java.lang.NumberFormatException - If the string does not contain a parsable short.

parseUShort

public static RefUShort parseUShort(java.lang.String s,
                                    int radix)
Assuming the specified String represents a short, returns that short's value.

Parameters:
s - The String containing the short.
radix - The radix to be used.
Returns:
The parsed value of the short.
Throws:
java.lang.NumberFormatException - If the string does not contain a parsable short.

clone

public RefUShort clone()
Create a clone of the current object.

Returns:
A clone of the current RefUShort.

cloneNumber

public RefNumber cloneNumber()
Create a clone of the current object.

Specified by:
cloneNumber in class RefNumber
Returns:
A clone of the current RefUShort.