|
|||||||||
| 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.StatValueImpl
class StatValueImpl
This class implements StatValue.
StatValue,
AbstractValueHolder| Field Summary | |
|---|---|
private static Interval |
ABSOLUTE_VALUE
This is the default Interval for the absolute value. |
private ValueHolder |
absoluteValue
This attribute holds the absolute value that does not depend on an Interval. |
private IValueHolderFactory |
factory
This is the factory instance that is responsible for creation of new ValueHolder instances and will be used mainly on registering new Intervals. |
private String |
name
This is the name of statistic value represented by this instance. |
private Map<String,ValueHolder> |
values
This map holds all values by the interval name it is responsible for. |
private List<ValueHolder> |
valuesAsList
This List contains a redundant copy of the values Map values. |
| Constructor Summary | |
|---|---|
StatValueImpl(String aName,
IValueHolderFactory aFactory)
This is the contructor. |
|
| Method Summary | |
|---|---|
void |
addInterval(Interval aInterval)
This method adds the given Interval. |
void |
decrease()
This method decreases the stored values for all Intervals by one. |
void |
decreaseByDouble(double aValue)
This method decreases the current values of all registered Intervals by the given double value. |
void |
decreaseByInt(int aValue)
This method decreases the current values of all registered Intervals by the given int value. |
void |
decreaseByLong(long aValue)
This method decreases the current values of all registered Intervals by the given long value. |
private ValueHolder |
getHolderByIntervalName(String aIntervalName)
This method returns the ValueHolder that is stored for the given Interval name. |
String |
getName()
This method returns the name of this statistic value. |
double |
getValueAsDouble()
This method returns the absolute value as double. |
double |
getValueAsDouble(String aIntervalName)
This method returns the current value of a specific Interval as double. |
int |
getValueAsInt()
This method returns the absolute value as int. |
int |
getValueAsInt(String aIntervalName)
This method returns the current value of a specific Interval as int. |
long |
getValueAsLong()
This method returns the absolute value as long. |
long |
getValueAsLong(String aIntervalName)
This method returns the current value of a specific Interval as long. |
void |
increase()
This method increases the stored values for all Intervals by one. |
void |
increaseByDouble(double aValue)
This method increases the current values of all registered Intervals by the given double value. |
void |
increaseByInt(int aValue)
This method increases the current values of all registered Intervals by the given int value. |
void |
increaseByLong(long aValue)
This method increases the current values of all registered Intervals by the given long value. |
void |
reset()
This method resets the ValueHolders of all registered Intervals. |
void |
setDefaultValueAsDouble(double aValue)
This method sets the default value that will be the initial value after an Interval was elapsed. |
void |
setDefaultValueAsInt(int aValue)
This method sets the default value that will be the initial value after an Interval was elapsed. |
void |
setDefaultValueAsLong(long aValue)
This method sets the default value that will be the initial value after an Interval was elapsed. |
void |
setValueAsDouble(double aValue)
This method sets the given double value to be the current value of all registered Intervals. |
void |
setValueAsInt(int aValue)
This method sets the given int value to be the current value of all registered Intervals. |
void |
setValueAsLong(long aValue)
This method sets the given long value to be the current value of all registered Intervals. |
void |
setValueIfGreaterThanCurrentAsDouble(double aValue)
This method sets the given double value to be the current value of all registered Intervals depending on the condition "current value < given value". |
void |
setValueIfGreaterThanCurrentAsInt(int aValue)
This method sets the given int value to be the current value of all registered Intervals depending on the condition "current value < given value". |
void |
setValueIfGreaterThanCurrentAsLong(long aValue)
This method sets the given long value to be the current value of all registered Intervals depending on the condition "current value < given value". |
void |
setValueIfLesserThanCurrentAsDouble(double aValue)
This method sets the given double value to be the current value of all registered Intervals depending on the condition "current value > given value". |
void |
setValueIfLesserThanCurrentAsInt(int aValue)
This method sets the given int value to be the current value of all registered Intervals depending on the condition "current value > given value". |
void |
setValueIfLesserThanCurrentAsLong(long aValue)
This method sets the given long value to be the current value of all registered Intervals depending on the condition "current value > given value". |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final Interval ABSOLUTE_VALUE
private ValueHolder absoluteValue
private Map<String,ValueHolder> values
private List<ValueHolder> valuesAsList
private String name
private transient IValueHolderFactory factory
| Constructor Detail |
|---|
public StatValueImpl(String aName,
IValueHolderFactory aFactory)
aName - the name of the statistic valueaFactory - the factory to create ValueHolder instances on Interval registration| Method Detail |
|---|
public void addInterval(Interval aInterval)
StatValue
addInterval in interface StatValueaInterval - the Interval to addStatValue.addInterval(net.java.dev.moskito.core.stats.Interval)public String toString()
toString in class ObjectObject.toString()public String getName()
StatValue
getName in interface StatValueStatValue.getName()public void increase()
StatValue
increase in interface StatValueStatValue.increase()public void decrease()
StatValue
decrease in interface StatValueStatValue.decrease()private ValueHolder getHolderByIntervalName(String aIntervalName)
aIntervalName - the name of the interval
UnknownIntervalException - if there is no ValueHolder stored for an Interval with the given namepublic int getValueAsInt()
StatValue
getValueAsInt in interface StatValueStatValue.getValueAsInt()public long getValueAsLong()
StatValue
getValueAsLong in interface StatValueStatValue.getValueAsLong()public double getValueAsDouble()
StatValue
getValueAsDouble in interface StatValueStatValue.getValueAsDouble()public int getValueAsInt(String aIntervalName)
StatValue
getValueAsInt in interface StatValueaIntervalName - the name of the Interval or null to get the absolute value
StatValue.getValueAsInt(java.lang.String)public long getValueAsLong(String aIntervalName)
StatValue
getValueAsLong in interface StatValueaIntervalName - the name of the Interval or null to get the absolute value
StatValue.getValueAsLong(java.lang.String)public double getValueAsDouble(String aIntervalName)
StatValue
getValueAsDouble in interface StatValueaIntervalName - the name of the Interval or null to get the absolute value
StatValue.getValueAsDouble(java.lang.String)public void setValueAsInt(int aValue)
StatValue
setValueAsInt in interface StatValueaValue - the new valueStatValue.setValueAsInt(int)public void setValueAsLong(long aValue)
StatValue
setValueAsLong in interface StatValueaValue - the new valueStatValue.setValueAsLong(long)public void setValueAsDouble(double aValue)
StatValue
setValueAsDouble in interface StatValueaValue - the new valueStatValue.setValueAsDouble(double)public void increaseByInt(int aValue)
StatValue
increaseByInt in interface StatValueaValue - the value to increment byStatValue.increaseByInt(int)public void increaseByLong(long aValue)
StatValue
increaseByLong in interface StatValueaValue - the value to increment byStatValue.increaseByLong(long)public void increaseByDouble(double aValue)
StatValue
increaseByDouble in interface StatValueaValue - the value to increment byStatValue.increaseByDouble(double)public void decreaseByInt(int aValue)
StatValue
decreaseByInt in interface StatValueaValue - the value to decrement byStatValue.decreaseByInt(int)public void decreaseByLong(long aValue)
StatValue
decreaseByLong in interface StatValueaValue - the value to decrement byStatValue.decreaseByLong(long)public void decreaseByDouble(double aValue)
StatValue
decreaseByDouble in interface StatValueaValue - the value to decrement byStatValue.decreaseByDouble(double)public void setDefaultValueAsLong(long aValue)
StatValue
setDefaultValueAsLong in interface StatValueaValue - the new default valueStatValue.setDefaultValueAsLong(long)public void setDefaultValueAsInt(int aValue)
StatValue
setDefaultValueAsInt in interface StatValueaValue - the new default valueStatValue.setDefaultValueAsInt(int)public void setDefaultValueAsDouble(double aValue)
StatValue
setDefaultValueAsDouble in interface StatValueaValue - the new default valueStatValue.setDefaultValueAsDouble(double)public void reset()
StatValue
reset in interface StatValueStatValue.reset()public void setValueIfGreaterThanCurrentAsLong(long aValue)
StatValue
setValueIfGreaterThanCurrentAsLong in interface StatValueaValue - the new valueStatValue.setValueIfGreaterThanCurrentAsLong(long)public void setValueIfGreaterThanCurrentAsInt(int aValue)
StatValue
setValueIfGreaterThanCurrentAsInt in interface StatValueaValue - the new valueStatValue.setValueIfGreaterThanCurrentAsInt(int)public void setValueIfGreaterThanCurrentAsDouble(double aValue)
StatValue
setValueIfGreaterThanCurrentAsDouble in interface StatValueaValue - the new valueStatValue.setValueIfGreaterThanCurrentAsDouble(double)public void setValueIfLesserThanCurrentAsLong(long aValue)
StatValue
setValueIfLesserThanCurrentAsLong in interface StatValueaValue - the new valueStatValue.setValueIfLesserThanCurrentAsLong(long)public void setValueIfLesserThanCurrentAsInt(int aValue)
StatValue
setValueIfLesserThanCurrentAsInt in interface StatValueaValue - the new valueStatValue.setValueIfLesserThanCurrentAsInt(int)public void setValueIfLesserThanCurrentAsDouble(double aValue)
StatValue
setValueIfLesserThanCurrentAsDouble in interface StatValueaValue - the new valueStatValue.setValueIfLesserThanCurrentAsDouble(double)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||