Package com.helger.commons.mutable
Class MutableBigInteger
- java.lang.Object
-
- java.lang.Number
-
- com.helger.commons.mutable.AbstractMutableNumeric<MutableBigInteger>
-
- com.helger.commons.mutable.MutableBigInteger
-
- All Implemented Interfaces:
IComparable<MutableBigInteger>,ICloneable<MutableBigInteger>,IMutableNumeric<MutableBigInteger>,IMutableObject<MutableBigInteger>,INumber,IGenericImplTrait<MutableBigInteger>,Serializable,Comparable<MutableBigInteger>
@NotThreadSafe public class MutableBigInteger extends AbstractMutableNumeric<MutableBigInteger>
Object wrapper around aBigIntegerso that it can be passed a final object but is mutable.- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MutableBigInteger(long nValue)MutableBigInteger(MutableBigInteger aOther)MutableBigInteger(BigInteger aValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(MutableBigInteger rhs)BigIntegerdec()BigIntegerdec(long nDelta)BigIntegerdec(MutableBigInteger aDelta)BigIntegerdec(BigInteger aDelta)BigIntegerdivide(long nDivisor)BigIntegerdivide(MutableBigInteger aDivisor)BigIntegerdivide(BigInteger 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.BigIntegergetAndInc()BigDecimalgetAsBigDecimal()BigIntegergetAsBigInteger()MutableBigIntegergetClone()inthashCode()BigIntegerinc()Increment by 1 and return the modified value.BigIntegerinc(long nDelta)BigIntegerinc(MutableBigInteger aDelta)BigIntegerinc(BigInteger aDelta)BigIntegerincAndGet()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.BigIntegermultiply(long nMultiplicand)BigIntegermultiply(MutableBigInteger aMultiplicand)BigIntegermultiply(BigInteger aMultiplicand)EChangeset(long nDelta)EChangeset(MutableBigInteger aValue)EChangeset(BigInteger 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
getAsByte, getAsCharacter, getAsDouble, getAsFloat, getAsInteger, getAsLong, getAsShort, isNot0
-
Methods inherited from interface com.helger.commons.mutable.INumber
byteValue, shortValue
-
-
-
-
Constructor Detail
-
MutableBigInteger
public MutableBigInteger(long nValue)
-
MutableBigInteger
public MutableBigInteger(@Nonnull MutableBigInteger aOther)
-
MutableBigInteger
public MutableBigInteger(@Nonnull BigInteger aValue)
-
-
Method Detail
-
getAsBigDecimal
@Nonnull public BigDecimal getAsBigDecimal()
-
getAsBigInteger
@Nonnull public BigInteger getAsBigInteger()
-
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.
-
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.
-
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
@Nonnull public BigInteger inc()
Increment by 1 and return the modified value.- Returns:
- The by 1 incremented value.
-
inc
@Nonnull public BigInteger inc(long nDelta)
-
inc
@Nonnull public BigInteger inc(@Nonnull MutableBigInteger aDelta)
-
inc
@Nonnull public BigInteger inc(@Nonnull BigInteger aDelta)
-
dec
@Nonnull public BigInteger dec()
-
dec
@Nonnull public BigInteger dec(long nDelta)
-
dec
@Nonnull public BigInteger dec(@Nonnull MutableBigInteger aDelta)
-
dec
@Nonnull public BigInteger dec(@Nonnull BigInteger aDelta)
-
divide
@Nonnull public BigInteger divide(long nDivisor)
-
divide
@Nonnull public BigInteger divide(@Nonnull MutableBigInteger aDivisor)
-
divide
@Nonnull public BigInteger divide(@Nonnull BigInteger aDivisor)
-
multiply
@Nonnull public BigInteger multiply(long nMultiplicand)
-
multiply
@Nonnull public BigInteger multiply(@Nonnull MutableBigInteger aMultiplicand)
-
multiply
@Nonnull public BigInteger multiply(@Nonnull BigInteger aMultiplicand)
-
set
@Nonnull public EChange set(@Nonnull MutableBigInteger aValue)
-
set
@Nonnull public EChange set(@Nonnull BigInteger aValue)
-
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
@Nonnull public BigInteger getAndInc()
-
incAndGet
@Nonnull public BigInteger incAndGet()
-
compareTo
public int compareTo(@Nonnull MutableBigInteger rhs)
-
getClone
@Nonnull public MutableBigInteger getClone()
- Returns:
- A 100% deep-copy of the implementing class.
-
-