Package org.quartz.utils.counter
Interface Counter
-
- All Known Subinterfaces:
SampledCounter,SampledRateCounter
- All Known Implementing Classes:
CounterImpl,SampledCounterImpl,SampledRateCounterImpl
public interface CounterA simple counter- Since:
- 1.8
- Author:
- Abhishek Sanoujam
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longdecrement()Decrement the counter by 1longdecrement(long amount)Decrement the counter by given amountlonggetAndSet(long newValue)Returns the value of the counter and sets it to the new valuelonggetValue()Gets current value of the counterlongincrement()Increment the counter by 1longincrement(long amount)Increment the counter by given amountvoidsetValue(long newValue)Sets the value of the counter to the supplied value
-
-
-
Method Detail
-
increment
long increment()
Increment the counter by 1- Returns:
- the value after incrementing
-
decrement
long decrement()
Decrement the counter by 1- Returns:
- the value after decrementing
-
getAndSet
long getAndSet(long newValue)
Returns the value of the counter and sets it to the new value- Parameters:
newValue-- Returns:
- Returns the old value
-
getValue
long getValue()
Gets current value of the counter- Returns:
- current value of the counter
-
increment
long increment(long amount)
Increment the counter by given amount- Parameters:
amount-- Returns:
- the value of the counter after incrementing
-
decrement
long decrement(long amount)
Decrement the counter by given amount- Parameters:
amount-- Returns:
- the value of the counter after decrementing
-
setValue
void setValue(long newValue)
Sets the value of the counter to the supplied value- Parameters:
newValue-
-
-