Package elki.logging.statistics
Class AtomicLongCounter
- java.lang.Object
-
- elki.logging.statistics.AbstractStatistic
-
- elki.logging.statistics.AtomicLongCounter
-
public class AtomicLongCounter extends AbstractStatistic implements Counter
Class to count events in a thread-safe counter.- Since:
- 0.6.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.concurrent.atomic.AtomicLong
counter
The counter to use.-
Fields inherited from class elki.logging.statistics.AbstractStatistic
key
-
-
Constructor Summary
Constructors Constructor Description AtomicLongCounter(java.lang.String key)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
decrement()
Decrement the counter.java.lang.String
formatValue()
Get a formatted version of the value, for output.long
getValue()
Get the current count.long
increment()
Increment the counter.long
increment(long i)
Increment the counter by i.-
Methods inherited from class elki.logging.statistics.AbstractStatistic
getKey, toString
-
-
-
-
Method Detail
-
increment
public long increment()
Description copied from interface:Counter
Increment the counter.
-
decrement
public long decrement()
Description copied from interface:Counter
Decrement the counter.
-
increment
public long increment(long i)
Description copied from interface:Counter
Increment the counter by i. Note: the increment may be negative!
-
getValue
public long getValue()
Description copied from interface:Counter
Get the current count.
-
formatValue
public java.lang.String formatValue()
Description copied from interface:Statistic
Get a formatted version of the value, for output.- Specified by:
formatValue
in interfaceStatistic
- Returns:
- Value
-
-