Class Counter.AtomicCounter

  • Enclosing class:
    Counter

    private static final class Counter.AtomicCounter
    extends Counter
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.atomic.AtomicLong count  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private AtomicCounter()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long addAndGet​(long delta)
      Adds the given delta to the counters current value
      long get()
      Returns the counters current value
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • count

        private final java.util.concurrent.atomic.AtomicLong count
    • Constructor Detail

      • AtomicCounter

        private AtomicCounter()
    • Method Detail

      • addAndGet

        public long addAndGet​(long delta)
        Description copied from class: Counter
        Adds the given delta to the counters current value
        Specified by:
        addAndGet in class Counter
        Parameters:
        delta - the delta to add
        Returns:
        the counters updated value
      • get

        public long get()
        Description copied from class: Counter
        Returns the counters current value
        Specified by:
        get in class Counter
        Returns:
        the counters current value