Top Description Fields Constructors Methods
net.sf.ehcache.util.counter.sampled

public Class SampledRateCounterImpl

extends SampledCounterImpl
implements SampledRateCounter
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.util.counter.sampled.SampledRateCounter, net.sf.ehcache.util.counter.sampled.SampledCounter, net.sf.ehcache.util.counter.Counter

An implementation of SampledRateCounter
Author
Abhishek Sanoujam
Since
1.7

Field Summary

Modifier and TypeField and Description
private long
private long
private static final String
Inherited from net.sf.ehcache.util.counter.sampled.SampledCounterImpl:
historyresetOnSample

Constructor Summary

AccessConstructor and Description
public
SampledRateCounterImpl(SampledRateCounterConfig config)

Constructor accepting the config

Method Summary

Modifier and TypeMethod and Description
public synchronized void
decrement(long numerator, long denominator)

Implements net.sf.ehcache.util.counter.sampled.SampledRateCounter.decrement.

Decrements the numerator and denominator by the passed values
public long
public long
public synchronized long
public long
public long
public long
public synchronized long
public synchronized void
increment(long numerator, long denominator)

Implements net.sf.ehcache.util.counter.sampled.SampledRateCounter.increment.

Increments the numerator and denominator by the passed values
public long
public long
public synchronized void
setDenominatorValue(long newValue)

Implements net.sf.ehcache.util.counter.sampled.SampledRateCounter.setDenominatorValue.

Sets the value of the denominator to the passed value
public synchronized void
setNumeratorValue(long newValue)

Implements net.sf.ehcache.util.counter.sampled.SampledRateCounter.setNumeratorValue.

Sets the value of the numerator to the passed value
public synchronized void
setValue(long numerator, long denominator)

Implements net.sf.ehcache.util.counter.sampled.SampledRateCounter.setValue.

Sets the values of the numerator and denominator to the passed values
public synchronized void
Inherited from net.sf.ehcache.util.counter.sampled.SampledCounterImpl:
getAllSampleValuesgetIntervalMillisgetMostRecentSamplegetTimerTaskrecordSampleshutdown

Field Detail

denominatorValueback to summary
private long denominatorValue
numeratorValueback to summary
private long numeratorValue
OPERATION_NOT_SUPPORTED_MSGback to summary
private static final String OPERATION_NOT_SUPPORTED_MSG

Constructor Detail

SampledRateCounterImplback to summary
public SampledRateCounterImpl(SampledRateCounterConfig config)

Constructor accepting the config

Method Detail

decrementback to summary
public synchronized void decrement(long numerator, long denominator)

Implements net.sf.ehcache.util.counter.sampled.SampledRateCounter.decrement.

Doc from net.sf.ehcache.util.counter.sampled.SampledRateCounter.decrement.

Decrements the numerator and denominator by the passed values

decrementback to summary
public long decrement()

Overrides net.sf.ehcache.util.counter.CounterImpl.decrement.

Implements net.sf.ehcache.util.counter.Counter.decrement.

throws UnsupportedOperationException

Returns:long

Doc from net.sf.ehcache.util.counter.Counter.decrement.

the value after decrementing

Annotations
@Override
decrementback to summary
public long decrement(long amount)

Overrides net.sf.ehcache.util.counter.CounterImpl.decrement.

Implements net.sf.ehcache.util.counter.Counter.decrement.

throws UnsupportedOperationException

Returns:long

Doc from net.sf.ehcache.util.counter.Counter.decrement.

the value of the counter after decrementing

Annotations
@Override
getAndResetback to summary
public synchronized long getAndReset()

Overrides net.sf.ehcache.util.counter.sampled.SampledCounterImpl.getAndReset.

Implements net.sf.ehcache.util.counter.sampled.SampledCounter.getAndReset.

Doc from net.sf.ehcache.util.counter.sampled.SampledCounter.getAndReset.

Returns the current value of the counter and resets it to 0

Returns:long

current value of the counter

Annotations
@Override
getAndSetback to summary
public long getAndSet(long newValue)

Overrides net.sf.ehcache.util.counter.CounterImpl.getAndSet.

Implements net.sf.ehcache.util.counter.Counter.getAndSet.

throws UnsupportedOperationException

Returns:long

Doc from net.sf.ehcache.util.counter.Counter.getAndSet.

Returns the old value

Annotations
@Override
getMaxValueback to summary
public long getMaxValue()

throws UnsupportedOperationException

getMinValueback to summary
public long getMinValue()

throws UnsupportedOperationException

getValueback to summary
public synchronized long getValue()

Overrides net.sf.ehcache.util.counter.CounterImpl.getValue.

Implements net.sf.ehcache.util.counter.Counter.getValue.

Doc from net.sf.ehcache.util.counter.Counter.getValue.

Gets current value of the counter

Returns:long

current value of the counter

Annotations
@Override
incrementback to summary
public synchronized void increment(long numerator, long denominator)

Implements net.sf.ehcache.util.counter.sampled.SampledRateCounter.increment.

Doc from net.sf.ehcache.util.counter.sampled.SampledRateCounter.increment.

Increments the numerator and denominator by the passed values

incrementback to summary
public long increment()

Overrides net.sf.ehcache.util.counter.CounterImpl.increment.

Implements net.sf.ehcache.util.counter.Counter.increment.

throws UnsupportedOperationException

Returns:long

Doc from net.sf.ehcache.util.counter.Counter.increment.

the value after incrementing

Annotations
@Override
incrementback to summary
public long increment(long amount)

Overrides net.sf.ehcache.util.counter.CounterImpl.increment.

Implements net.sf.ehcache.util.counter.Counter.increment.

throws UnsupportedOperationException

Returns:long

Doc from net.sf.ehcache.util.counter.Counter.increment.

the value of the counter after incrementing

Annotations
@Override
setDenominatorValueback to summary
public synchronized void setDenominatorValue(long newValue)

Implements net.sf.ehcache.util.counter.sampled.SampledRateCounter.setDenominatorValue.

Doc from net.sf.ehcache.util.counter.sampled.SampledRateCounter.setDenominatorValue.

Sets the value of the denominator to the passed value

setNumeratorValueback to summary
public synchronized void setNumeratorValue(long newValue)

Implements net.sf.ehcache.util.counter.sampled.SampledRateCounter.setNumeratorValue.

Doc from net.sf.ehcache.util.counter.sampled.SampledRateCounter.setNumeratorValue.

Sets the value of the numerator to the passed value

setValueback to summary
public synchronized void setValue(long numerator, long denominator)

Implements net.sf.ehcache.util.counter.sampled.SampledRateCounter.setValue.

Doc from net.sf.ehcache.util.counter.sampled.SampledRateCounter.setValue.

Sets the values of the numerator and denominator to the passed values

setValueback to summary
public synchronized void setValue(long newValue)

Overrides net.sf.ehcache.util.counter.CounterImpl.setValue.

Implements net.sf.ehcache.util.counter.Counter.setValue.

throws UnsupportedOperationException

Annotations
@Override