public abstract class ShelfStatistic extends AbstractValue
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.| Modifier and Type | Class and Description |
|---|---|
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.
|
PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
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<Number> |
numbers
A list of numbers gathered from the data source.
|
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWNKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Modifier | Constructor and Description |
|---|---|
protected |
ShelfStatistic(Map<String,String> prop)
Constructs a new shelf-based statistics sensor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
get, setcreateParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, init, overrideDefaultName, register, rescanned, setName, toStringclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, 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, parseObject, reload, removeProperty, requires, setObject, setProperties, setProperty, stringPropertiesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFormatted, getName, getStringdefaultBoolean, 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, stringPropertiesinitpublic 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 double minima
private double maxima
private double average
public void clear()
public Number setValue(Number add)
protected Number getAverage()
protected Number getMaximum()
protected Number getMinimum()
public boolean isValid()
private void scanMinMax()