Interface Counter

All Superinterfaces:
Serializable

public interface Counter extends Serializable
Counter
Version:
$Id$
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Decrements by one the current counter value.
    long
    Gets the current counter value, regardless whether it's enabled or not.
    long
    Increments by one the current counter value.
    void
    Resets the counter, regardless whether it's enabled or not.
  • Method Details

    • getValue

      long getValue()
      Gets the current counter value, regardless whether it's enabled or not.
    • increment

      long increment()
      Increments by one the current counter value.
      Returns:
      the incremented value if enabled. Otherwise, returns 0.
    • decrement

      long decrement()
      Decrements by one the current counter value.
      Returns:
      the decremented value if enabled. Otherwise, returns 0.
    • reset

      void reset()
      Resets the counter, regardless whether it's enabled or not.