Class LongCounter.Wrapper

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable
    Enclosing class:
    LongCounter

    private static class LongCounter.Wrapper
    extends LongCounter
    Base wrapper class for other wrappers.
    • Constructor Summary

      Constructors 
      Constructor Description
      Wrapper​(LongCounter counter)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Return a cloned copy of this object.
      long decrement()
      Decrement the counter.
      boolean equals​(java.lang.Object obj)
      Check if the given object is equal to this.
      long getCount()
      Return the current value of the counter.
      long increment()
      Increment the counter.
      void reset()
      Reset the counter to zero.
      java.lang.String toString()
      Return a string representation of this.
      • Methods inherited from class java.lang.Object

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

      • serialVersionUID

        private static final long serialVersionUID
        The serialVersionUID
        See Also:
        Constant Field Values
      • counter

        protected final LongCounter counter
        The wrapped counter
    • Constructor Detail

    • Method Detail

      • increment

        public long increment()
        Description copied from class: LongCounter
        Increment the counter. (Optional operation)
        Overrides:
        increment in class LongCounter
        Returns:
        The incremented value of the counter.
      • decrement

        public long decrement()
        Description copied from class: LongCounter
        Decrement the counter. (Optional operation)
        Overrides:
        decrement in class LongCounter
        Returns:
        The decremented value of the counter.
      • getCount

        public long getCount()
        Description copied from class: LongCounter
        Return the current value of the counter.
        Overrides:
        getCount in class LongCounter
        Returns:
        The current value of the counter.
      • reset

        public void reset()
        Description copied from class: LongCounter
        Reset the counter to zero. (Optional operation)
        Overrides:
        reset in class LongCounter
      • equals

        public boolean equals​(java.lang.Object obj)
        Description copied from class: LongCounter
        Check if the given object is equal to this.
        Overrides:
        equals in class LongCounter
        Parameters:
        obj - Object to test equality with.
        Returns:
        True if object is equal to this.
      • toString

        public java.lang.String toString()
        Description copied from class: LongCounter
        Return a string representation of this.
        Overrides:
        toString in class LongCounter
        Returns:
        A string representation of this.
      • clone

        public java.lang.Object clone()
        Description copied from class: LongCounter
        Return a cloned copy of this object.
        Overrides:
        clone in class LongCounter
        Returns:
        A cloned copy of this object.