|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.parameter.AbstractParameter
stella.parameter.AbstractValue
stella.parameter.ShelfStatistic
public abstract class ShelfStatistic
This class hooks on to a shelf to generate minima/maxima or averages. The
intended use is to hook this parameter to a DataCaster that is
permanently generating data. Retrieving the value is either minima, maxima
or average. It is similar to a SensorStatistic, but provides not
that much of an overhead.
| Nested Class Summary | |
|---|---|
static class |
ShelfStatistic.Average
Useable class returning the average. |
static class |
ShelfStatistic.Maximum
Useable class returning the average. |
static class |
ShelfStatistic.Minimum
Useable class returning the average. |
static class |
ShelfStatistic.Test
Test class. |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private double |
average
The current average. |
private static boolean |
DEFNOMINMAX
The default choice for ignoring minima maxima calculation. |
private static int |
DEFSHELFSIZE
The length of the average cycle. |
private static int |
DEFTHRESHOLD
The minimum length of the shelf to return valid values. |
static String |
KEY_NOMINMAX
If this boolean is set, minima/maxima are not updated. |
static String |
KEY_SHELFSIZE
The length of the average cycle. |
static String |
KEY_THRESHOLD
The minimum length of the shelf to return valid values. |
private double |
maxima
The current maxima. |
private double |
minima
The current minima. |
private Shelf |
numbers
A list of numbers gathered from the data source. |
| Fields inherited from class stella.parameter.AbstractParameter |
|---|
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
protected |
ShelfStatistic(Map prop)
Constructs a new shelf-based statistics sensor. |
| Method Summary | |
|---|---|
void |
clear()
Clears the shelf data on request. |
protected Number |
getAverage()
From all accumulated numbers, get the average. |
protected Number |
getMaximum()
From all accumulated numbers, get the maximum. |
protected Number |
getMinimum()
From all accumulated numbers, get the maximum. |
boolean |
isValid()
A statistiv parameter is valid, if its numbers collected exceeds the validity threshold. |
private void |
scanMinMax()
If we removed the minima or the maxima from our shelf, and this value is no longer present in the data shelf, we have to scan the entire shelf for the new minima and maxima. |
Number |
setValue(Number add)
Adds a number to the shelf statistic. |
| Methods inherited from class stella.parameter.AbstractValue |
|---|
get, set |
| Methods inherited from class stella.parameter.AbstractParameter |
|---|
createParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, init, register, rescanned, setName, toString |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, setObject, setProperties, setProperty, stringProperties |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface stella.Value |
|---|
getValue |
| Methods inherited from interface stella.Parameter |
|---|
getFormatted, getName, getString |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Methods inherited from interface util.Initializable |
|---|
init |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Field Detail |
|---|
public static final String KEY_SHELFSIZE
public static final String KEY_THRESHOLD
public static final String KEY_NOMINMAX
private static final int DEFSHELFSIZE
private static final int DEFTHRESHOLD
private static final boolean DEFNOMINMAX
private Shelf numbers
private double minima
private double maxima
private double average
| Constructor Detail |
|---|
protected ShelfStatistic(Map prop)
| Method Detail |
|---|
public void clear()
public Number setValue(Number add)
protected Number getAverage()
protected Number getMaximum()
protected Number getMinimum()
public boolean isValid()
private void scanMinMax()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||