public class CounterStatistic extends Object
Keep total, current and maximum values of a counter that can be incremented and decremented. The total refers only to increments.
Modifier and Type | Field and Description |
---|---|
protected AtomicLong |
_curr |
protected AtomicLong |
_max |
protected AtomicLong |
_total |
Constructor and Description |
---|
CounterStatistic() |
protected final AtomicLong _max
protected final AtomicLong _curr
protected final AtomicLong _total
public void reset()
public void reset(long value)
public long add(long delta)
delta
- the amount to add to the countpublic long increment()
public long decrement()
public long getMax()
public long getCurrent()
public long getTotal()
Copyright © 1995-2015 Webtide. All Rights Reserved.