Class IntAccumulator

java.lang.Object
org.midheaven.math.IntAccumulator
All Implemented Interfaces:
Comparable<Int>, Ordered<Int>, Signed<IntAccumulator>

public final class IntAccumulator extends Object implements Ordered<Int>, Signed<IntAccumulator>
Represents Int Accumulator.
  • Constructor Details

    • IntAccumulator

      public IntAccumulator()
      Creates a new IntAccumulator.
    • IntAccumulator

      public IntAccumulator(Int initialValue)
      Creates a new IntAccumulator.
      Parameters:
      initialValue - the initialValue value
    • IntAccumulator

      public IntAccumulator(IntAccumulator other)
      Creates a new IntAccumulator.
      Parameters:
      other - the other value
  • Method Details

    • increment

      public void increment()
      Performs increment.
    • decrement

      public void decrement()
      Performs decrement.
    • incrementBy

      public void incrementBy(IntAccumulator other)
      Performs incrementBy.
      Parameters:
      other - the other value
    • incrementBy

      public void incrementBy(Int other)
      Performs incrementBy.
      Parameters:
      other - the other value
    • times

      public IntAccumulator times(IntAccumulator other)
      Performs times.
      Parameters:
      other - the other value
      Returns:
      the result of times
    • get

      public Int get()
      Performs get.
      Returns:
      the result of get
    • compareTo

      public int compareTo(Int o)
      Performs compareTo.
      Specified by:
      compareTo in interface Comparable<Int>
      Parameters:
      o - the o value
      Returns:
      the result of compareTo
    • sign

      public int sign()
      Performs sign.
      Specified by:
      sign in interface Signed<IntAccumulator>
      Returns:
      the result of sign
    • isZero

      public boolean isZero()
      Checks whether is Zero.
      Specified by:
      isZero in interface Signed<IntAccumulator>
      Returns:
      the result of isZero
    • toBigInteger

      public BigInteger toBigInteger()
      Returns to Big Integer.
      Returns:
      the result of toBigInteger
    • negate

      public IntAccumulator negate()
      Performs negate.
      Specified by:
      negate in interface Signed<IntAccumulator>
      Returns:
      the result of negate