Package elki.logging.statistics
Class UnsynchronizedLongCounter
- java.lang.Object
-
- elki.logging.statistics.AbstractStatistic
-
- elki.logging.statistics.UnsynchronizedLongCounter
-
public class UnsynchronizedLongCounter 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) longcounterThe counter to use.-
Fields inherited from class elki.logging.statistics.AbstractStatistic
key
-
-
Constructor Summary
Constructors Constructor Description UnsynchronizedLongCounter(java.lang.String key)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longdecrement()Decrement the counter.java.lang.StringformatValue()Get a formatted version of the value, for output.longgetValue()Get the current count.longincrement()Increment the counter.longincrement(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:CounterIncrement the counter.
-
decrement
public long decrement()
Description copied from interface:CounterDecrement the counter.
-
increment
public long increment(long i)
Description copied from interface:CounterIncrement the counter by i. Note: the increment may be negative!
-
getValue
public long getValue()
Description copied from interface:CounterGet the current count.
-
formatValue
public java.lang.String formatValue()
Description copied from interface:StatisticGet a formatted version of the value, for output.- Specified by:
formatValuein interfaceStatistic- Returns:
- Value
-
-