public class CounterStatistic
extends java.lang.Object
Statistics on a counter value.
This class keeps the total, current and maximum value of a counter that can be incremented and decremented. The total refers only to increments.
| Constructor | Description |
|---|---|
CounterStatistic() |
| Modifier and Type | Method | Description |
|---|---|---|
long |
add(long delta) |
|
long |
decrement() |
Decrements the value by one.
|
long |
getCurrent() |
|
long |
getMax() |
|
long |
getTotal() |
|
long |
increment() |
Increments the value by one.
|
void |
reset() |
Resets the max and total to the current value.
|
void |
reset(long value) |
Resets the max, total and current value to the given parameter.
|
java.lang.String |
toString() |
public void reset()
public void reset(long value)
value - the new current valuepublic long add(long delta)
delta - the amount to add to the counterpublic long increment()
public long decrement()
public long getMax()
public long getCurrent()
public long getTotal()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 1995–2018 Webtide. All rights reserved.