Interface LongUpDownCounter

All Superinterfaces:
Instrument

public interface LongUpDownCounter extends Instrument
A counter for registering long measurements that can be incremented/decreased.
  • Method Details

    • add

      void add(long value)
      Adds a value to the counter.
      Parameters:
      value - The increment amount. May be positive, negative or zero.
    • getValueAsLong

      long getValueAsLong()
      Returns:
      the value for the counter as a long.
    • getValueAsInt

      int getValueAsInt()
      Returns:
      the value for the counter as a int.
    • getUnit

      String getUnit()
      Returns:
      the unit for this measurement.
    • getMeter

      Meter getMeter()
      Specified by:
      getMeter in interface Instrument
      Returns:
      the Meter.
    • incrementAndGetAsInt

      int incrementAndGetAsInt()
      increments the counter and gets the value as an int.
      Returns:
      the resulting value as int.
    • incrementAndGetAsLong

      long incrementAndGetAsLong()
      increments the counter and gets the value as a long.
      Returns:
      the resulting value as long.
    • decrementAndGetAsInt

      int decrementAndGetAsInt()
      decrements the counter and gets the value as an int.
      Returns:
      the resulting value as int.
    • decrementAndGetAsLong

      long decrementAndGetAsLong()
      decrements the counter and gets the value as a long.
      Returns:
      the resulting value as long.