float wrapper.
This class was created before the introduction of the the java. package and the DoubleAccumulator class.
Note that as MutableFloat does not extend Float, it is not treated by String.format as a Float parameter.
Float, DoubleAccumulator, DoubleAdder
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Required for serialization support.
|
| private float | value
The mutable value. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | MutableFloat(final float
the initial value to store. value)Constructs a new MutableFloat with the specified value. |
| public | MutableFloat(final Number
the initial value to store, not null. value)Constructs a new MutableFloat with the specified value. |
| public | MutableFloat(final String
the string to parse, not null. value)Constructs a new MutableFloat parsing the given string. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public float | Returns: the value associated with this instance after adding the operand.the quantity to add, not null. operand)Increments this instance's value by |
| public float | |
| public int | Returns: negative if this is less, zero if equal, positive if greater.the other mutable to compare to, not null. other)Implements java. Compares this mutable to another in ascending order. |
| public void | |
| public float | Returns: the value associated with the instance after it is decremented.Decrements this instance's value by 1; this method returns the value associated with the instance immediately after the decrement operation. |
| public double | Returns: the numeric value represented by this object after conversion to type double.Implements abstract java. Returns the value of this MutableFloat as a double. |
| public boolean | Returns: true if the objects are the same; false otherwise.the object to compare with, null returns false. obj)Overrides java. Compares this object against some other object. |
| public float | Returns: the numeric value represented by this object after conversion to type float.Implements abstract java. Returns the value of this MutableFloat as a float. |
| public float | Returns: the value associated with this instance immediately before the operand was added.the quantity to add, not null. operand)Increments this instance's value by |
| public float | |
| public float | Returns: the value associated with the instance before it was decremented.Decrements this instance's value by 1; this method returns the value associated with the instance immediately prior to the decrement operation. |
| public float | Returns: the value associated with the instance before it was incremented.Increments this instance's value by 1; this method returns the value associated with the instance immediately prior to the increment operation. |
| public Float | Returns: the value as a Float, never null.Implements org.
Deprecated
Use
get().
Gets the value as a Float instance. |
| public int | Returns: a suitable hash code.Overrides java. Returns a suitable hash code for this mutable. |
| public void | |
| public float | Returns: the value associated with the instance after it is incremented.Increments this instance's value by 1; this method returns the value associated with the instance immediately after the increment operation. |
| public int | Returns: the numeric value represented by this object after conversion to type int.Implements abstract java. Returns the value of this MutableFloat as an int. |
| public boolean | |
| public boolean | |
| public long | Returns: the numeric value represented by this object after conversion to type long.Implements abstract java. Returns the value of this MutableFloat as a long. |
| public void | setValue(final float
the value to set. value)Implements org. Sets the value. |
| public void | setValue(final Number
the value to set, not null. value)Implements org. Sets the value from any Number instance. |
| public void | subtract(final float
the value to subtract. operand)Subtracts a value from the value of this instance. |
| public void | |
| public Float | Returns: a Float instance containing the value from this mutable, never null.Gets this mutable as an instance of Float. |
| public String | Returns: the mutable value as a string.Overrides java. Returns the String value of this mutable. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. Required for serialization support.
| |
| value | back to summary |
|---|---|
| private float value The mutable value. | |
| MutableFloat | back to summary |
|---|---|
| public MutableFloat() Constructs a new MutableFloat with the default value of zero. | |
| MutableFloat | back to summary |
|---|---|
| public MutableFloat(final float value) Constructs a new MutableFloat with the specified value.
| |
| MutableFloat | back to summary |
|---|---|
| public MutableFloat(final Number value) Constructs a new MutableFloat with the specified value.
| |
| MutableFloat | back to summary |
|---|---|
| public MutableFloat(final String value) Constructs a new MutableFloat parsing the given string.
| |
| add | back to summary |
|---|---|
| public void add(final float operand) Adds a value to the value of this instance.
| |
| add | back to summary |
|---|---|
| public void add(final Number operand) Adds a value to the value of this instance.
| |
| addAndGet | back to summary |
|---|---|
| public float addAndGet(final float operand) Increments this instance's value by
| |
| addAndGet | back to summary |
|---|---|
| public float addAndGet(final Number operand) Increments this instance's value by
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(final MutableFloat other) Implements java. Compares this mutable to another in ascending order.
| |
| decrement | back to summary |
|---|---|
| public void decrement() Decrements the value.
| |
| decrementAndGet | back to summary |
|---|---|
| public float decrementAndGet() Decrements this instance's value by 1; this method returns the value associated with the instance immediately after the decrement operation. This method is not thread safe.
| |
| doubleValue | back to summary |
|---|---|
| public double doubleValue() Implements abstract java. Returns the value of this MutableFloat as a double.
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Compares this object against some other object. The result is
Note that in most cases, for two instances of class f1.floatValue() == f2.floatValue()
also has the value
This definition allows hashtables to operate properly.
| |
| floatValue | back to summary |
|---|---|
| public float floatValue() Implements abstract java. Returns the value of this MutableFloat as a float.
| |
| getAndAdd | back to summary |
|---|---|
| public float getAndAdd(final float operand) Increments this instance's value by
| |
| getAndAdd | back to summary |
|---|---|
| public float getAndAdd(final Number operand) Increments this instance's value by
| |
| getAndDecrement | back to summary |
|---|---|
| public float getAndDecrement() Decrements this instance's value by 1; this method returns the value associated with the instance immediately prior to the decrement operation. This method is not thread safe.
| |
| getAndIncrement | back to summary |
|---|---|
| public float getAndIncrement() Increments this instance's value by 1; this method returns the value associated with the instance immediately prior to the increment operation. This method is not thread safe.
| |
| getValue | back to summary |
|---|---|
| public Float getValue() Implements org. Deprecated Use Gets the value as a Float instance.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a suitable hash code for this mutable.
| |
| increment | back to summary |
|---|---|
| public void increment() Increments the value.
| |
| incrementAndGet | back to summary |
|---|---|
| public float incrementAndGet() Increments this instance's value by 1; this method returns the value associated with the instance immediately after the increment operation. This method is not thread safe.
| |
| intValue | back to summary |
|---|---|
| public int intValue() Implements abstract java. Returns the value of this MutableFloat as an int.
| |
| isInfinite | back to summary |
|---|---|
| public boolean isInfinite() Checks whether the float value is infinite.
| |
| isNaN | back to summary |
|---|---|
| public boolean isNaN() Checks whether the float value is the special NaN value.
| |
| longValue | back to summary |
|---|---|
| public long longValue() Implements abstract java. Returns the value of this MutableFloat as a long.
| |
| setValue | back to summary |
|---|---|
| public void setValue(final float value) Implements org. Sets the value.
| |
| setValue | back to summary |
|---|---|
| public void setValue(final Number value) Implements org. Sets the value from any Number instance.
| |
| subtract | back to summary |
|---|---|
| public void subtract(final float operand) Subtracts a value from the value of this instance.
| |
| subtract | back to summary |
|---|---|
| public void subtract(final Number operand) Subtracts a value from the value of this instance.
| |
| toFloat | back to summary |
|---|---|
| public Float toFloat() Gets this mutable as an instance of Float.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns the String value of this mutable. | |