public class TypeAwareStatValueImpl extends java.lang.Object implements TypeAwareStatValue
StatValueImpl type with a StatValueTypes value.| Modifier and Type | Field and Description |
|---|---|
protected ValueHolder |
absoluteValue
This attribute holds the absolute value that does not depend on an Interval.
|
protected java.util.Map<java.lang.String,ValueHolder> |
values
This map holds all values by the interval name it is responsible for.
|
| Constructor and Description |
|---|
TypeAwareStatValueImpl(java.lang.String aName,
StatValueTypes svType,
IValueHolderFactory aFactory)
Constructs an instance of TypeAwareStatValueImpl.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
destroy()
Called when the owner stats object is removed from the system.
|
java.lang.String |
getName()
This method returns the name of this statistic value.
|
StatValueTypes |
getType() |
double |
getValueAsDouble()
This method returns the absolute value as double.
|
double |
getValueAsDouble(java.lang.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(java.lang.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(java.lang.String aIntervalName)
This method returns the current value of a specific Interval as long.
|
java.lang.String |
getValueAsString() |
java.lang.String |
getValueAsString(java.lang.String intervalName) |
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 |
setValueAsString(java.lang.String aValue)
Sets the value as String.
|
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".
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddInterval, decrease, decreaseByDouble, decreaseByInt, decreaseByLong, destroy, getName, getValueAsDouble, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, increase, increaseByDouble, increaseByInt, increaseByLong, reset, setDefaultValueAsDouble, setDefaultValueAsInt, setDefaultValueAsLong, setValueAsDouble, setValueAsInt, setValueAsLong, setValueAsString, setValueIfGreaterThanCurrentAsDouble, setValueIfGreaterThanCurrentAsInt, setValueIfGreaterThanCurrentAsLong, setValueIfLesserThanCurrentAsDouble, setValueIfLesserThanCurrentAsInt, setValueIfLesserThanCurrentAsLongprotected ValueHolder absoluteValue
protected java.util.Map<java.lang.String,ValueHolder> values
public TypeAwareStatValueImpl(java.lang.String aName,
StatValueTypes svType,
IValueHolderFactory aFactory)
aName - the name of the statistic valuesvType - the StatValueTypesaFactory - the factory to create ValueHolder instances on Interval registrationpublic StatValueTypes getType()
getType in interface TypeAwareStatValueStatValueTypes value.public void addInterval(Interval aInterval)
StatValueaddInterval in interface StatValueaInterval - the Interval to addpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public java.lang.String getName()
StatValuepublic void increase()
StatValuepublic void decrease()
StatValuepublic int getValueAsInt()
StatValuegetValueAsInt in interface StatValuepublic long getValueAsLong()
StatValuegetValueAsLong in interface StatValuepublic double getValueAsDouble()
StatValuegetValueAsDouble in interface StatValuepublic int getValueAsInt(java.lang.String aIntervalName)
StatValuegetValueAsInt in interface StatValueaIntervalName - the name of the Interval or null to get the absolute valuepublic long getValueAsLong(java.lang.String aIntervalName)
StatValuegetValueAsLong in interface StatValueaIntervalName - the name of the Interval or null to get the absolute valuepublic double getValueAsDouble(java.lang.String aIntervalName)
StatValuegetValueAsDouble in interface StatValueaIntervalName - the name of the Interval or null to get the absolute valuepublic void setValueAsInt(int aValue)
StatValuesetValueAsInt in interface StatValueaValue - the new valuepublic void setValueAsString(java.lang.String aValue)
StatValuesetValueAsString in interface StatValuepublic void setValueAsLong(long aValue)
StatValuesetValueAsLong in interface StatValueaValue - the new valuepublic void setValueAsDouble(double aValue)
StatValuesetValueAsDouble in interface StatValueaValue - the new valuepublic void increaseByInt(int aValue)
StatValueincreaseByInt in interface StatValueaValue - the value to increment bypublic void increaseByLong(long aValue)
StatValueincreaseByLong in interface StatValueaValue - the value to increment bypublic void increaseByDouble(double aValue)
StatValueincreaseByDouble in interface StatValueaValue - the value to increment bypublic void decreaseByInt(int aValue)
StatValuedecreaseByInt in interface StatValueaValue - the value to decrement bypublic void decreaseByLong(long aValue)
StatValuedecreaseByLong in interface StatValueaValue - the value to decrement bypublic void decreaseByDouble(double aValue)
StatValuedecreaseByDouble in interface StatValueaValue - the value to decrement bypublic void setDefaultValueAsLong(long aValue)
StatValuesetDefaultValueAsLong in interface StatValueaValue - the new default valuepublic void setDefaultValueAsInt(int aValue)
StatValuesetDefaultValueAsInt in interface StatValueaValue - the new default valuepublic void setDefaultValueAsDouble(double aValue)
StatValuesetDefaultValueAsDouble in interface StatValueaValue - the new default valuepublic void reset()
StatValuepublic void setValueIfGreaterThanCurrentAsLong(long aValue)
StatValuesetValueIfGreaterThanCurrentAsLong in interface StatValueaValue - the new valuepublic void setValueIfGreaterThanCurrentAsInt(int aValue)
StatValuesetValueIfGreaterThanCurrentAsInt in interface StatValueaValue - the new valuepublic void setValueIfGreaterThanCurrentAsDouble(double aValue)
StatValuesetValueIfGreaterThanCurrentAsDouble in interface StatValueaValue - the new valuepublic void setValueIfLesserThanCurrentAsLong(long aValue)
StatValuesetValueIfLesserThanCurrentAsLong in interface StatValueaValue - the new valuepublic void setValueIfLesserThanCurrentAsInt(int aValue)
StatValuesetValueIfLesserThanCurrentAsInt in interface StatValueaValue - the new valuepublic void setValueIfLesserThanCurrentAsDouble(double aValue)
StatValuesetValueIfLesserThanCurrentAsDouble in interface StatValueaValue - the new valuepublic java.lang.String getValueAsString(java.lang.String intervalName)
getValueAsString in interface StatValuepublic java.lang.String getValueAsString()
getValueAsString in interface StatValueCopyright © 2010-2020 anotheria.net. All Rights Reserved.