public class CounterStatistic extends 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 and Description |
---|
CounterStatistic() |
Modifier and Type | Method and 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.
|
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()
Copyright © 2010 - 2020 Adobe. All Rights Reserved