| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
Numberorg.apache.commons.lang.mutable.MutableFloatfloat wrapper.
FloatConstructor Summary | |
| |
| |
| |
Method Summary | |
int |
|
double |
|
boolean |
|
float |
|
Object |
|
int |
|
int |
|
boolean |
|
boolean |
|
long |
|
void |
|
void |
|
String |
|
public MutableFloat()
Constructs a new MutableFloat with the default value of zero.
public MutableFloat(Number value)
Constructs a new MutableFloat with the specified value.
- Parameters:
value- a value.
public MutableFloat(float value)
Constructs a new MutableFloat with the specified value.
- Parameters:
value- a value.
public int compareTo(Object obj)
Compares this mutable to another in ascending order.
- Parameters:
obj- the mutable to compare to
- Returns:
- negative if this is less, zero if equal, positive if greater
public double doubleValue()
Returns the value of this MutableFloat as a double.
- Returns:
- the numeric value represented by this object after conversion to type double.
public boolean equals(Object obj)
Compares this object against some other object. The result istrueif and only if the argument is notnulland is aFloatobject that represents afloatthat has the identical bit pattern to the bit pattern of thefloatrepresented by this object. For this purpose, two float values are considered to be the same if and only if the methodFloat.floatToIntBits(float)returns the same int value when applied to each. Note that in most cases, for two instances of classFloat,f1andf2, the value off1.equals(f2)istrueif and only ifalso has the valuef1.floatValue() == f2.floatValue()true. However, there are two exceptions:This definition allows hashtables to operate properly.
- If
f1andf2both representFloat.NaN, then theequalsmethod returnstrue, even thoughFloat.NaN==Float.NaNhas the valuefalse.- If
f1represents+0.0fwhilef2represents-0.0f, or vice versa, theequaltest has the valuefalse, even though0.0f==-0.0fhas the valuetrue.
- Parameters:
obj- the object to be compared
- Returns:
trueif the objects are the same;falseotherwise.
- See Also:
Float.floatToIntBits(float)
public float floatValue()
Returns the value of this MutableFloat as a float.
- Returns:
- the numeric value represented by this object after conversion to type float.
public Object getValue()
Gets the value as a Float instance.
- Returns:
- the value as a Float
public int hashCode()
Returns a suitable hashcode for this mutable.
- Returns:
- a suitable hashcode
public int intValue()
Returns the value of this MutableFloat as a int.
- Returns:
- the numeric value represented by this object after conversion to type int.
public boolean isInfinite()
Checks whether the float value is infinite.
- Returns:
- true if infinite
public boolean isNaN()
Checks whether the float value is the special NaN value.
- Returns:
- true if NaN
public long longValue()
Returns the value of this MutableFloat as a long.
- Returns:
- the numeric value represented by this object after conversion to type long.
public void setValue(Object value)
Sets the value from any Number instance.
- Parameters:
value- the value to set
public void setValue(float value)
Sets the value.
- Parameters:
value- the value to set
public String toString()
Returns the String value of this mutable.
- Returns:
- the mutable value as a string