rebuild.util.ref
Class RefFloat

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

public final class RefFloat
extends RefNumber

Reference Float is the same as Float but allows you to set the float without creating a new RefFloat.

Since:
BBX 1.1.0

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

See Also:
Constant Field Values

MIN_VALUE

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

See Also:
Constant Field Values

NaN

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

See Also:
Constant Field Values

NEGATIVE_INFINITY

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

See Also:
Constant Field Values

POSITIVE_INFINITY

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

See Also:
Constant Field Values
Constructor Detail

RefFloat

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


RefFloat

public RefFloat(float value)
Create a new RefFloat using a float primitive.

Parameters:
value - The float primitive to set this RefFloat with.

RefFloat

public RefFloat(float value,
                boolean fixed)
Create a new RefFloat using a float primitive.

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

RefFloat

public RefFloat(java.lang.Float value)
Create a new RefFloat using a Float.

Parameters:
value - The Float to set this RefFloat with.

RefFloat

public RefFloat(java.lang.Float value,
                boolean fixed)
Create a new RefFloat using a Float.

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

doubleValue

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

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

setValue

public RefFloat setValue(float value)
Set the value of this RefFloat object with a float primitive.

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

setValue

public RefFloat setValue(java.lang.Float value)
Set the value of this RefFloat object with a Float.

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

hashCode

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

Returns:
This RefFloat as a byte.

floatToIntBits

public static int floatToIntBits(float value)
Returns the bit representation of a single-float value.

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

floatValue

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

Returns:
The float value represented by this object.

intValue

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

Returns:
The float 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 RefFloat 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(float 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 RefFloat 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(float 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.

intBitsToFloat

public static float intBitsToFloat(int bits)
Returns the single-float corresponding to a given bit representation.

Parameters:
bits - An integer.
Returns:
The single-format floating-point value with the same bit pattern.

longValue

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

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

parseFloat

public static float parseFloat(java.lang.String s)
Returns a new float initialized to the value represented by the specified String.

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

shortValue

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

Returns:
The RefFloat cast to a short.

toString

public static java.lang.String toString(float d)
Returns a String representation for the specified float value.

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

valueOf

public static RefFloat valueOf(java.lang.String s)
Returns the floating point value represented by the specified String.

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

clone

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

Returns:
A clone of the current RefFloat.

cloneNumber

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

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