rebuild.util.ref
Class RefInteger

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

public final class RefInteger
extends RefNumber

Reference Integer is the same as Integer but allows you to set the int without creating a new RefInteger.

Since:
BBX 1.1.0

Field Summary
static int MAX_VALUE
          The largest value of type int.
static int MIN_VALUE
          The smallest value of type int.
 
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
RefInteger()
          Create a new RefInteger set to the default of 0.
RefInteger(int value)
          Create a new RefInteger using a int primitive.
RefInteger(int value, boolean fixed)
          Create a new RefInteger using a int primitive.
RefInteger(java.lang.Integer value)
          Create a new RefInteger using a Integer.
RefInteger(java.lang.Integer value, boolean fixed)
          Create a new RefInteger using a Integer.
 
Method Summary
 byte byteValue()
          Returns the value of this Integer as a byte.
 RefInteger clone()
          Create a clone of the current object.
 RefNumber cloneNumber()
          Create a clone of the current object.
 double doubleValue()
          Returns the value of this Integer as a double.
 float floatValue()
          Returns the value of this Integer as a float.
 int hashCode()
          Returns a hash code for this RefInteger object.
 int intValue()
          Returns Returns the value of this RefInteger as an int.
 long longValue()
          Returns the value of this Integer as a long.
static int parseInt(java.lang.String s)
          Parses the string argument as a signed decimal integer.
static int parseInt(java.lang.String s, int radix)
          Parses the string argument as a signed integer in the radix specified by the second argument.
 RefInteger setValue(int value)
          Set the value of this RefInteger object with a int primitive.
 RefInteger setValue(java.lang.Integer value)
          Set the value of this RefInteger object with a Integer.
 short shortValue()
          Returns the value of this Integer as a short.
static java.lang.String toBinaryString(int i)
          Creates a string representation of the integer argument as an unsigned integer in base 2.
static java.lang.String toHexString(int i)
          Creates a string representation of the integer argument as an unsigned integer in base 16.
static java.lang.String toOctalString(int i)
          Creates a string representation of the integer argument as an unsigned integer in base 8.
 java.lang.String toString()
          Returns a String object representing this RefInteger's value.
static java.lang.String toString(int i)
          Returns A new String object representing the specified integer.
static java.lang.String toString(int i, int radix)
          Creates a string representation of the first argument in the radix specified by the second argument.
static RefInteger valueOf(java.lang.String s)
          Returns a new RefInteger object initialized to the value of the specified String.
static RefInteger valueOf(java.lang.String s, int radix)
          Returns a new RefInteger object initialized to the value of the specified String.
 
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

public static final int MAX_VALUE
The largest value of type int.

See Also:
Constant Field Values

MIN_VALUE

public static final int MIN_VALUE
The smallest value of type int.

See Also:
Constant Field Values
Constructor Detail

RefInteger

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


RefInteger

public RefInteger(int value)
Create a new RefInteger using a int primitive.

Parameters:
value - The int primitive to set this RefInteger with.

RefInteger

public RefInteger(int value,
                  boolean fixed)
Create a new RefInteger using a int primitive.

Parameters:
value - The int primitive to set this RefInteger with.
fixed - If this item is read only and cannot be modified.

RefInteger

public RefInteger(java.lang.Integer value)
Create a new RefInteger using a Integer.

Parameters:
value - The Integer to set this RefInteger with.

RefInteger

public RefInteger(java.lang.Integer value,
                  boolean fixed)
Create a new RefInteger using a Integer.

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

intValue

public int intValue()
Returns Returns the value of this RefInteger as an int.

Returns:
The int value represented by this object.

setValue

public RefInteger setValue(int value)
Set the value of this RefInteger object with a int primitive.

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

setValue

public RefInteger setValue(java.lang.Integer value)
Set the value of this RefInteger object with a Integer.

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

hashCode

public int hashCode()
Returns a hash code for this RefInteger 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 RefInteger's value.

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

byteValue

public byte byteValue()
Returns the value of this Integer as a byte.

Returns:
Returns the value of this Integer as a byte.

doubleValue

public double doubleValue()
Returns the value of this Integer as a double.

Returns:
The int value represented by this object is converted to type double and the result of the conversion is returned.

floatValue

public float floatValue()
Returns the value of this Integer as a float.

Returns:
The int value represented by this object is converted to type float and the result of the conversion is returned.

longValue

public long longValue()
Returns the value of this Integer as a long.

Returns:
The int value represented by this object that is converted to type long and the result of the conversion is returned.

shortValue

public short shortValue()
Returns the value of this Integer as a short.

Returns:
The int value represented by this object that is converted to type short and the result of the conversion is returned.

parseInt

public static int parseInt(java.lang.String s)
Parses the string argument as a signed decimal integer.

Parameters:
s - A string.
Returns:
The integer represented by the argument in decimal.
Throws:
java.lang.NumberFormatException - If the string does not contain a parsable integer.

parseInt

public static int parseInt(java.lang.String s,
                           int radix)
Parses the string argument as a signed integer in the radix specified by the second argument.

Parameters:
s - The String containing the integer.
radix - The radix to be used.
Returns:
The integer represented by the string argument in the specified radix.
Throws:
java.lang.NumberFormatException - If the string does not contain a parsable integer.

toBinaryString

public static java.lang.String toBinaryString(int i)
Creates a string representation of the integer argument as an unsigned integer in base 2.

Parameters:
i - An integer.
Returns:
The string representation of the unsigned integer value represented by the argument in binary (base 2).

toHexString

public static java.lang.String toHexString(int i)
Creates a string representation of the integer argument as an unsigned integer in base 16.

Parameters:
i - An integer.
Returns:
The string representation of the unsigned integer value represented by the argument in hexadecimal (base 16).

toOctalString

public static java.lang.String toOctalString(int i)
Creates a string representation of the integer argument as an unsigned integer in base 8.

Parameters:
i - An integer.
Returns:
The string representation of the unsigned integer value represented by the argument in octal (base 8).

toString

public static java.lang.String toString(int i)
Returns A new String object representing the specified integer.

Parameters:
i - An integer to be converted.
Returns:
A string representation of the argument in base 10.

toString

public static java.lang.String toString(int i,
                                        int radix)
Creates a string representation of the first argument in the radix specified by the second argument.

Parameters:
i - An integer.
radix - The radix.
Returns:
A string representation of the argument in the specified radix.

valueOf

public static RefInteger valueOf(java.lang.String s)
Returns a new RefInteger object initialized to the value of the specified String.

Parameters:
s - The string to be parsed.
Returns:
A newly constructed RefInteger initialized to the value represented by the string argument.
Throws:
java.lang.NumberFormatException - If the string cannot be parsed as an integer.

valueOf

public static RefInteger valueOf(java.lang.String s,
                                 int radix)
Returns a new RefInteger object initialized to the value of the specified String.

Parameters:
s - The string to be parsed.
radix - The radix of the integer represented by string s.
Returns:
A newly constructed RefInteger initialized to the value represented by the string argument in the specified radix.
Throws:
java.lang.NumberFormatException - If the String cannot be parsed as an int.

clone

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

Returns:
A clone of the current RefInteger.

cloneNumber

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

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