Class AtomicLongCounter

  • All Implemented Interfaces:
    LongCounter

    final class AtomicLongCounter
    extends java.lang.Object
    implements LongCounter
    An implementation of LongCounter that is just an AtomicLong.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.atomic.AtomicLong counter  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(long delta)
      Adds the delta to this counter.
      long value()
      Returns the value of this counter.
      • Methods inherited from class java.lang.Object

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

      • counter

        private final java.util.concurrent.atomic.AtomicLong counter
    • Method Detail

      • add

        public void add​(long delta)
        Description copied from interface: LongCounter
        Adds the delta to this counter.
        Specified by:
        add in interface LongCounter
      • value

        public long value()
        Description copied from interface: LongCounter
        Returns the value of this counter.
        Specified by:
        value in interface LongCounter