Class Counters.BigIntegerCounter

  • All Implemented Interfaces:
    Counters.Counter
    Enclosing class:
    Counters

    private static final class Counters.BigIntegerCounter
    extends java.lang.Object
    implements Counters.Counter
    Counts using a BigInteger number.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.math.BigInteger value  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private BigIntegerCounter()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(long val)
      Adds the given number to this counter.
      boolean equals​(java.lang.Object obj)  
      long get()
      Gets the counter as a long.
      java.math.BigInteger getBigInteger()
      Gets the counter as a BigInteger.
      java.lang.Long getLong()
      Gets the counter as a Long.
      int hashCode()  
      void increment()
      Adds one to this counter.
      void reset()
      Resets this count to 0.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • value

        private java.math.BigInteger value
    • Constructor Detail

      • BigIntegerCounter

        private BigIntegerCounter()
    • Method Detail

      • add

        public void add​(long val)
        Description copied from interface: Counters.Counter
        Adds the given number to this counter.
        Specified by:
        add in interface Counters.Counter
        Parameters:
        val - the value to add.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • get

        public long get()
        Description copied from interface: Counters.Counter
        Gets the counter as a long.
        Specified by:
        get in interface Counters.Counter
        Returns:
        the counter as a long.
      • getBigInteger

        public java.math.BigInteger getBigInteger()
        Description copied from interface: Counters.Counter
        Gets the counter as a BigInteger.
        Specified by:
        getBigInteger in interface Counters.Counter
        Returns:
        the counter as a BigInteger.
      • getLong

        public java.lang.Long getLong()
        Description copied from interface: Counters.Counter
        Gets the counter as a Long.
        Specified by:
        getLong in interface Counters.Counter
        Returns:
        the counter as a Long.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object