rebuild.util.ref
Class RefDouble

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

public final class RefDouble
extends RefNumber

Reference Double is the same as Double but allows you to set the double without creating a new Double.

Since:
BBX 1.1.0

Field Summary
static double MAX_VALUE
          The largest positive finite value of type double.
static double MIN_VALUE
          The smallest positive value of type double.
static double NaN
          A Not-a-Number (NaN) value of type double.
static double NEGATIVE_INFINITY
          The negative infinity of type double.
static double POSITIVE_INFINITY
          The positive infinity of type double.
 
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
RefDouble()
          Create a new RefDouble set to the default of 0.0.
RefDouble(double value)
          Create a new RefDouble using a double primitive.
RefDouble(java.lang.Double value)
          Create a new RefDouble using a Double.
RefDouble(double value, boolean fixed)
          Create a new RefDouble using a double primitive.
RefDouble(java.lang.Double value, boolean fixed)
          Create a new RefDouble using a Double.
 
Method Summary
 byte byteValue()
          Returns the value of this RefDouble as a byte (by casting to a byte).
 RefDouble clone()
          Create a clone of the current object.
 RefNumber cloneNumber()
          Create a clone of the current object.
static long doubleToLongBits(double value)
          Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "double format" bit layout.
 double doubleValue()
          Returns The value of this RefDouble object as a double primitive.
 float floatValue()
          Returns the float value of this RefDouble.
 int hashCode()
          Returns a hash code for this RefDouble object.
 int intValue()
          Returns the integer value of this RefDouble (by casting to an int).
 boolean isInfinite()
          Returns true if this RefDouble value is infinitely large in magnitude.
static boolean isInfinite(double v)
          Returns true if the specified number is infinitely large in magnitude.
 boolean isNaN()
          Returns true if this RefDouble value is the special Not-a-Number (NaN) value.
static boolean isNaN(double v)
          Returns true if the specified number is the special Not-a-Number (NaN) value.
static double longBitsToDouble(long bits)
          Returns the double-float corresponding to a given bit representation.
 long longValue()
          Returns the long value of this RefDouble (by casting to a long).
static double parseDouble(java.lang.String s)
          Returns a new double initialized to the value represented by the specified String, as performed by the valueOf method of class RefDouble.
 RefDouble setValue(double value)
          Set the value of this RefDouble object with a double primitive.
 RefDouble setValue(java.lang.Double value)
          Set the value of this RefDouble object with a Double.
 short shortValue()
          Returns the value of this RefDouble as a short (by casting to a short).
 java.lang.String toString()
          Returns a String object representing this RefDouble's value.
static java.lang.String toString(double d)
          Creates a string representation of the double argument.
static RefDouble valueOf(java.lang.String s)
          Returns a new RefDouble object initialized to the value represented by 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 double MAX_VALUE
The largest positive finite value of type double.

See Also:
Constant Field Values

MIN_VALUE

public static final double MIN_VALUE
The smallest positive value of type double.

See Also:
Constant Field Values

NaN

public static final double NaN
A Not-a-Number (NaN) value of type double.

See Also:
Constant Field Values

NEGATIVE_INFINITY

public static final double NEGATIVE_INFINITY
The negative infinity of type double.

See Also:
Constant Field Values

POSITIVE_INFINITY

public static final double POSITIVE_INFINITY
The positive infinity of type double.

See Also:
Constant Field Values
Constructor Detail

RefDouble

public RefDouble()
Create a new RefDouble set to the default of 0.0.


RefDouble

public RefDouble(double value)
Create a new RefDouble using a double primitive.

Parameters:
value - The double primitive to set this RefDouble with.

RefDouble

public RefDouble(double value,
                 boolean fixed)
Create a new RefDouble using a double primitive.

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

RefDouble

public RefDouble(java.lang.Double value)
Create a new RefDouble using a Double.

Parameters:
value - The Double to set this RefDouble with.

RefDouble

public RefDouble(java.lang.Double value,
                 boolean fixed)
Create a new RefDouble using a Double.

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

doubleValue

public double doubleValue()
Returns The value of this RefDouble object as a double primitive.

Returns:
The primitive double value of this object.

setValue

public RefDouble setValue(double value)
Set the value of this RefDouble object with a double primitive.

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

setValue

public RefDouble setValue(java.lang.Double value)
Set the value of this RefDouble object with a Double.

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

hashCode

public int hashCode()
Returns a hash code for this RefDouble 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 RefDouble'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 RefDouble as a byte (by casting to a byte).

Returns:
This RefDouble as a byte.

doubleToLongBits

public static long doubleToLongBits(double value)
Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "double format" bit layout.

Parameters:
value - A double precision floating-point number.
Returns:
The bits that represent the floating-point number.

floatValue

public float floatValue()
Returns the float value of this RefDouble.

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

intValue

public int intValue()
Returns the integer value of this RefDouble (by casting to an int).

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

isInfinite

public boolean isInfinite()
Returns true if this RefDouble value is infinitely large in magnitude.

Returns:
true if the value represented by this object is positive infinity or negative infinity; false otherwise.

isInfinite

public static boolean isInfinite(double v)
Returns true if the specified number is infinitely large in magnitude.

Parameters:
v - The value to be tested.
Returns:
true if the value of the argument is positive infinity or negative infinity; false otherwise.

isNaN

public boolean isNaN()
Returns true if this RefDouble value is the special Not-a-Number (NaN) value.

Returns:
true if the value represented by this object is NaN; false otherwise.

isNaN

public static boolean isNaN(double v)
Returns true if the specified number is the special Not-a-Number (NaN) value.

Parameters:
v - The value to be tested.
Returns:
true if the value of the argument is NaN; false otherwise.

longBitsToDouble

public static double longBitsToDouble(long bits)
Returns the double-float corresponding to a given bit representation.

Parameters:
bits - Any long integer.
Returns:
The double floating-point value with the same bit pattern.

longValue

public long longValue()
Returns the long value of this RefDouble (by casting to a long).

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

parseDouble

public static double parseDouble(java.lang.String s)
Returns a new double initialized to the value represented by the specified String, as performed by the valueOf method of class RefDouble.

Parameters:
s - The string to be parsed.
Returns:
The double value represented by the string argument.
Throws:
java.lang.NumberFormatException - If the string does not contain a parsable double.

shortValue

public short shortValue()
Returns the value of this RefDouble as a short (by casting to a short).

Returns:
The RefDouble cast to a short.

toString

public static java.lang.String toString(double d)
Creates a string representation of the double argument.

Parameters:
d - The double to be converted.
Returns:
A string representation of the argument.

valueOf

public static RefDouble valueOf(java.lang.String s)
Returns a new RefDouble object initialized to the value represented by the specified string.

Parameters:
s - The string to be parsed.
Returns:
A newly constructed RefDouble initialized to the value represented by the string argument.
Throws:
java.lang.NumberFormatException - If the string does not contain a parsable number.

clone

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

Returns:
A clone of the current RefDouble.

cloneNumber

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

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