Package org.quartz.utils.counter.sampled
Class SampledRateCounterImpl
- java.lang.Object
-
- org.quartz.utils.counter.CounterImpl
-
- org.quartz.utils.counter.sampled.SampledCounterImpl
-
- org.quartz.utils.counter.sampled.SampledRateCounterImpl
-
- All Implemented Interfaces:
java.io.Serializable
,Counter
,SampledCounter
,SampledRateCounter
public class SampledRateCounterImpl extends SampledCounterImpl implements SampledRateCounter
An implementation ofSampledRateCounter
- Since:
- 1.8
- Author:
- Abhishek Sanoujam
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.quartz.utils.counter.sampled.SampledCounterImpl
history, resetOnSample
-
-
Constructor Summary
Constructors Constructor Description SampledRateCounterImpl(SampledRateCounterConfig config)
Constructor accepting the config
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
decrement()
throwsUnsupportedOperationException
long
decrement(long amount)
throwsUnsupportedOperationException
void
decrement(long numerator, long denominator)
Decrements the numerator and denominator by the passed valueslong
getAndReset()
Returns the current value of the counter and resets it to 0long
getAndSet(long newValue)
throwsUnsupportedOperationException
long
getMaxValue()
throwsUnsupportedOperationException
long
getMinValue()
throwsUnsupportedOperationException
long
getValue()
Gets current value of the counterlong
increment()
throwsUnsupportedOperationException
long
increment(long amount)
throwsUnsupportedOperationException
void
increment(long numerator, long denominator)
Increments the numerator and denominator by the passed valuesvoid
setDenominatorValue(long newValue)
Sets the value of the denominator to the passed valuevoid
setNumeratorValue(long newValue)
Sets the value of the numerator to the passed valuevoid
setValue(long newValue)
throwsUnsupportedOperationException
void
setValue(long numerator, long denominator)
Sets the values of the numerator and denominator to the passed values-
Methods inherited from class org.quartz.utils.counter.sampled.SampledCounterImpl
getAllSampleValues, getIntervalMillis, getMostRecentSample, getTimerTask, shutdown
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.quartz.utils.counter.sampled.SampledCounter
getAllSampleValues, getMostRecentSample, shutdown
-
-
-
-
Constructor Detail
-
SampledRateCounterImpl
public SampledRateCounterImpl(SampledRateCounterConfig config)
Constructor accepting the config- Parameters:
config
-
-
-
Method Detail
-
setValue
public void setValue(long numerator, long denominator)
Sets the values of the numerator and denominator to the passed values- Specified by:
setValue
in interfaceSampledRateCounter
-
increment
public void increment(long numerator, long denominator)
Increments the numerator and denominator by the passed values- Specified by:
increment
in interfaceSampledRateCounter
-
decrement
public void decrement(long numerator, long denominator)
Decrements the numerator and denominator by the passed values- Specified by:
decrement
in interfaceSampledRateCounter
-
setDenominatorValue
public void setDenominatorValue(long newValue)
Sets the value of the denominator to the passed value- Specified by:
setDenominatorValue
in interfaceSampledRateCounter
-
setNumeratorValue
public void setNumeratorValue(long newValue)
Sets the value of the numerator to the passed value- Specified by:
setNumeratorValue
in interfaceSampledRateCounter
-
getValue
public long getValue()
Gets current value of the counter- Specified by:
getValue
in interfaceCounter
- Overrides:
getValue
in classCounterImpl
- Returns:
- current value of the counter
-
getAndReset
public long getAndReset()
Returns the current value of the counter and resets it to 0- Specified by:
getAndReset
in interfaceSampledCounter
- Overrides:
getAndReset
in classSampledCounterImpl
- Returns:
- current value of the counter
-
getAndSet
public long getAndSet(long newValue)
throwsUnsupportedOperationException
- Specified by:
getAndSet
in interfaceCounter
- Overrides:
getAndSet
in classCounterImpl
- Returns:
- Returns the old value
-
setValue
public void setValue(long newValue)
throwsUnsupportedOperationException
- Specified by:
setValue
in interfaceCounter
- Overrides:
setValue
in classCounterImpl
-
decrement
public long decrement()
throwsUnsupportedOperationException
- Specified by:
decrement
in interfaceCounter
- Overrides:
decrement
in classCounterImpl
- Returns:
- the value after decrementing
-
decrement
public long decrement(long amount)
throwsUnsupportedOperationException
- Specified by:
decrement
in interfaceCounter
- Overrides:
decrement
in classCounterImpl
- Returns:
- the value of the counter after decrementing
-
getMaxValue
public long getMaxValue()
throwsUnsupportedOperationException
-
getMinValue
public long getMinValue()
throwsUnsupportedOperationException
-
increment
public long increment()
throwsUnsupportedOperationException
- Specified by:
increment
in interfaceCounter
- Overrides:
increment
in classCounterImpl
- Returns:
- the value after incrementing
-
increment
public long increment(long amount)
throwsUnsupportedOperationException
- Specified by:
increment
in interfaceCounter
- Overrides:
increment
in classCounterImpl
- Returns:
- the value of the counter after incrementing
-
-