Interface Counter

All Superinterfaces:
Metric
All Known Implementing Classes:
CounterImpl

@LimitedPrivate("Coprocesssor") @Evolving public interface Counter extends Metric
A mutable number optimized for high concurrency counting.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Decrement this by 1.
    void
    decrement(long n)
    Decrement this by n.
    long
    Returns the current value.
    void
    Increment this by 1.
    void
    increment(long n)
    Increment this by n.
  • Method Details

    • increment

      void increment()
      Increment this by 1.
    • increment

      void increment(long n)
      Increment this by n.
      Parameters:
      n - The amount to increment.
    • decrement

      void decrement()
      Decrement this by 1.
    • decrement

      void decrement(long n)
      Decrement this by n.
      Parameters:
      n - The amount to decrement.
    • getCount

      long getCount()
      Returns the current value.
      Returns:
      the current value.