Class Counter.SerialCounter

  • Enclosing class:
    Counter

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

      Fields 
      Modifier and Type Field Description
      private long count  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private SerialCounter()  
    • 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 long count
    • Constructor Detail

      • SerialCounter

        private SerialCounter()
    • 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