Package org.midheaven.math
Class IntAccumulator
java.lang.Object
org.midheaven.math.IntAccumulator
- All Implemented Interfaces:
Comparable<Int>,Ordered<Int>,Signed<IntAccumulator>
Represents Int Accumulator.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new IntAccumulator.IntAccumulator(Int initialValue) Creates a new IntAccumulator.IntAccumulator(IntAccumulator other) Creates a new IntAccumulator. -
Method Summary
Modifier and TypeMethodDescriptionintPerforms compareTo.voidPerforms decrement.get()Performs get.voidPerforms increment.voidincrementBy(Int other) Performs incrementBy.voidincrementBy(IntAccumulator other) Performs incrementBy.booleanisZero()Checks whether is Zero.negate()Performs negate.intsign()Performs sign.times(IntAccumulator other) Performs times.Returns to Big Integer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.midheaven.lang.Ordered
isEqualTo, isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualToMethods inherited from interface org.midheaven.lang.Signed
abs, isNegative, isPositive
-
Constructor Details
-
IntAccumulator
public IntAccumulator()Creates a new IntAccumulator. -
IntAccumulator
Creates a new IntAccumulator.- Parameters:
initialValue- the initialValue value
-
IntAccumulator
Creates a new IntAccumulator.- Parameters:
other- the other value
-
-
Method Details
-
increment
public void increment()Performs increment. -
decrement
public void decrement()Performs decrement. -
incrementBy
Performs incrementBy.- Parameters:
other- the other value
-
incrementBy
Performs incrementBy.- Parameters:
other- the other value
-
times
Performs times.- Parameters:
other- the other value- Returns:
- the result of times
-
get
Performs get.- Returns:
- the result of get
-
compareTo
Performs compareTo.- Specified by:
compareToin interfaceComparable<Int>- Parameters:
o- the o value- Returns:
- the result of compareTo
-
sign
public int sign()Performs sign.- Specified by:
signin interfaceSigned<IntAccumulator>- Returns:
- the result of sign
-
isZero
public boolean isZero()Checks whether is Zero.- Specified by:
isZeroin interfaceSigned<IntAccumulator>- Returns:
- the result of isZero
-
toBigInteger
Returns to Big Integer.- Returns:
- the result of toBigInteger
-
negate
Performs negate.- Specified by:
negatein interfaceSigned<IntAccumulator>- Returns:
- the result of negate
-