|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.java.dev.moskito.core.stats.impl.AbstractValueHolder
net.java.dev.moskito.core.stats.impl.IntValueHolder
class IntValueHolder
This class implements a ValueHolder that is able to process int values.
ValueHolder| Field Summary | |
|---|---|
private AtomicInteger |
currentValue
This attribute stores the current value supporting concurrent access. |
static int |
DEFAULT_DEFAULT_VALUE
This is the value that will be used as defaultValue if no other one was specified. |
private int |
defaultValue
This is the default value that this ValueHolder contains after a reset. |
private int |
lastValue
The last value will be stored here. |
| Constructor Summary | |
|---|---|
IntValueHolder(Interval aInterval)
The Constructor. |
|
| Method Summary | |
|---|---|
void |
decrease()
This method shall decrement the value by one. |
void |
decreaseByDouble(double aValue)
This method shall decrement the current value by the given amount. |
void |
decreaseByInt(int aValue)
This method shall decrement the current value by the given amount. |
void |
decreaseByLong(long aValue)
This method shall decrement the current value by the given amount. |
double |
getCurrentValueAsDouble()
This method shall return the current value as double for internal use only. |
int |
getCurrentValueAsInt()
This method shall return the current value as int for internal use only. |
long |
getCurrentValueAsLong()
This method shall return the current value as long for internal use only. |
int |
getLastValue()
This method returns the lastValue. |
double |
getValueAsDouble()
This method shall return the current value as double. |
int |
getValueAsInt()
This method shall return the current value as int. |
long |
getValueAsLong()
This method shall return the current value as long. |
void |
increase()
This method shall increment the value by one. |
void |
increaseByDouble(double aValue)
This method shall increment the current value by the given amount. |
void |
increaseByInt(int aValue)
This method shall increment the current value by the given amount. |
void |
increaseByLong(long aValue)
This method shall increment the current value by the given amount. |
void |
intervalUpdated(Interval aCaller)
This method will be called if the time of the given Interval was elapsed. |
void |
reset()
This method shall reset the ValueHolder. |
void |
setDefaultValueAsDouble(double aValue)
This method shall set a new default value. |
void |
setDefaultValueAsInt(int aValue)
This method shall set a new default value. |
void |
setDefaultValueAsLong(long aValue)
This method shall set a new default value. |
void |
setValueAsDouble(double aValue)
This method shall assign the given value to the current value. |
void |
setValueAsInt(int aValue)
This method shall assign the given value to the current value. |
void |
setValueAsLong(long aValue)
This method shall assign the given value to the current value. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_DEFAULT_VALUE
private AtomicInteger currentValue
private int lastValue
private int defaultValue
| Constructor Detail |
|---|
public IntValueHolder(Interval aInterval)
aInterval - this is the Interval this value will be updated| Method Detail |
|---|
public void intervalUpdated(Interval aCaller)
IIntervalListener
aCaller - The Interval that calls this methodnet.java.dev.moskito.core.stats.IIntervalListener#intervalUpdated(net.java.dev.moskito.core.stats.impl.IntervalImpl)public int getLastValue()
public String toString()
toString in class AbstractValueHolderAbstractValueHolder.toString()public void decrease()
ValueHolder
ValueHolder.decrease()public void increase()
ValueHolder
ValueHolder.increase()public void decreaseByDouble(double aValue)
ValueHolder
aValue - the amountValueHolder.decreaseByDouble(double)public void decreaseByInt(int aValue)
ValueHolder
aValue - the amountValueHolder.decreaseByInt(int)public void decreaseByLong(long aValue)
ValueHolder
aValue - the amountValueHolder.decreaseByLong(long)public double getValueAsDouble()
ValueHolder
ValueHolder.getValueAsDouble()public int getValueAsInt()
ValueHolder
ValueHolder.getValueAsInt()public long getValueAsLong()
ValueHolder
ValueHolder.getValueAsLong()public void increaseByDouble(double aValue)
ValueHolder
aValue - the amountValueHolder.increaseByDouble(double)public void increaseByInt(int aValue)
ValueHolder
aValue - the amountValueHolder.increaseByInt(int)public void increaseByLong(long aValue)
ValueHolder
aValue - the amountValueHolder.increaseByLong(long)public void setValueAsDouble(double aValue)
ValueHolder
aValue - the new valueValueHolder.setValueAsDouble(double)public void setValueAsInt(int aValue)
ValueHolder
aValue - the new valueValueHolder.setValueAsInt(int)public void setValueAsLong(long aValue)
ValueHolder
aValue - the new valueValueHolder.setValueAsLong(long)public void setDefaultValueAsLong(long aValue)
ValueHolder
aValue - the new default valueValueHolder.setDefaultValueAsLong(long)public void setDefaultValueAsInt(int aValue)
ValueHolder
aValue - the new default valueValueHolder.setDefaultValueAsInt(int)public void setDefaultValueAsDouble(double aValue)
ValueHolder
aValue - the new default valueValueHolder.setDefaultValueAsDouble(double)public void reset()
ValueHolder
ValueHolder.reset()public double getCurrentValueAsDouble()
ValueHolder
ValueHolder.getCurrentValueAsDouble()public int getCurrentValueAsInt()
ValueHolder
ValueHolder.getCurrentValueAsInt()public long getCurrentValueAsLong()
ValueHolder
ValueHolder.getCurrentValueAsLong()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||