Package com.helger.commons.mutable
Class MutableFloat
- java.lang.Object
-
- java.lang.Number
-
- com.helger.commons.mutable.AbstractMutableNumeric<MutableFloat>
-
- com.helger.commons.mutable.MutableFloat
-
- All Implemented Interfaces:
IComparable<MutableFloat>,ICloneable<MutableFloat>,IMutableNumeric<MutableFloat>,IMutableObject<MutableFloat>,INumber,IGenericImplTrait<MutableFloat>,Serializable,Comparable<MutableFloat>
@NotThreadSafe public class MutableFloat extends AbstractMutableNumeric<MutableFloat>
Object wrapper around a float so that it can be passed a final object but is mutable.- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MutableFloat(float fValue)MutableFloat(Number aValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(MutableFloat rhs)floatdec()floatdec(float fDelta)floatdec(Number aDelta)floatdivide(float fDivisor)floatdivide(Number aDivisor)doubledoubleValue()Returns the value of the specified number as adouble, which may involve rounding.booleanequals(Object o)floatfloatValue()Returns the value of the specified number as afloat, which may involve rounding.floatgetAndInc()MutableFloatgetClone()inthashCode()floatinc()Increment by 1 and return the modified value.floatinc(float fDelta)floatinc(Number aDelta)floatincAndGet()intintValue()Returns the value of the specified number as anint, which may involve rounding or truncation.booleanis0()booleanisGE0()booleanisGT0()booleanisLE0()booleanisLT0()longlongValue()Returns the value of the specified number as along, which may involve rounding or truncation.floatmultiply(float fMultiplicand)floatmultiply(Number aMultiplicand)EChangeset(float fValue)EChangeset(Number aValue)StringtoString()-
Methods inherited from class com.helger.commons.mutable.AbstractMutableNumeric
onAfterChange
-
Methods inherited from class java.lang.Number
byteValue, shortValue
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.commons.compare.IComparable
isEQ, isGE, isGT, isLE, isLT, isNE
-
Methods inherited from interface com.helger.commons.traits.IGenericImplTrait
thisAsT
-
Methods inherited from interface com.helger.commons.mutable.IMutableNumeric
getAsBigDecimal, getAsBigInteger, getAsByte, getAsCharacter, getAsDouble, getAsFloat, getAsInteger, getAsLong, getAsShort, isNot0
-
Methods inherited from interface com.helger.commons.mutable.INumber
byteValue, shortValue
-
-
-
-
Method Detail
-
floatValue
public float floatValue()
Description copied from interface:INumberReturns the value of the specified number as afloat, which may involve rounding.- Specified by:
floatValuein interfaceINumber- Specified by:
floatValuein classNumber- Returns:
- the numeric value represented by this object after conversion to
type
float.
-
doubleValue
public double doubleValue()
Description copied from interface:INumberReturns the value of the specified number as adouble, which may involve rounding.- Specified by:
doubleValuein interfaceINumber- Specified by:
doubleValuein classNumber- Returns:
- the numeric value represented by this object after conversion to
type
double.
-
intValue
public int intValue()
Description copied from interface:INumberReturns the value of the specified number as anint, which may involve rounding or truncation.
-
longValue
public long longValue()
Description copied from interface:INumberReturns the value of the specified number as along, which may involve rounding or truncation.
-
inc
public float inc()
Increment by 1 and return the modified value.- Returns:
- The by 1 incremented value.
-
inc
public float inc(float fDelta)
-
dec
public float dec()
-
dec
public float dec(float fDelta)
-
divide
public float divide(float fDivisor)
-
multiply
public float multiply(float fMultiplicand)
-
is0
public boolean is0()
- Returns:
trueif the value is 0
-
isLT0
public boolean isLT0()
- Returns:
trueif the value is < 0
-
isLE0
public boolean isLE0()
- Returns:
trueif the value is ≤ 0
-
isGT0
public boolean isGT0()
- Returns:
trueif the value is > 0
-
isGE0
public boolean isGE0()
- Returns:
trueif the value is ≥ 0
-
getAndInc
public float getAndInc()
-
incAndGet
public float incAndGet()
-
compareTo
public int compareTo(@Nonnull MutableFloat rhs)
-
getClone
@Nonnull public MutableFloat getClone()
- Returns:
- A 100% deep-copy of the implementing class.
-
-