stella.parameter
Class SumWatch
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.parameter.AbstractParameter
stella.parameter.AbstractValue
stella.parameter.SumWatch
- All Implemented Interfaces:
- Cloneable, Parameter, AfterRegistering, ParameterDepending, Value, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, Reloadable, ResourceSupplying
public class SumWatch
- extends AbstractValue
- implements ParameterDepending, AfterRegistering, Reloadable
A sum watch takes several StopWatches and returns their summed
value on request.
|
Field Summary |
static String |
KEY_SUMUP
The list of names of stop watches to add. |
private List |
watches
The list of truely registered watches. |
private List |
wish
The list of watches we want. |
|
Constructor Summary |
SumWatch(Map prop)
Constructs a new observation time. |
| Methods inherited from class stella.parameter.AbstractParameter |
createParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, setName, toString |
| 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 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 |
KEY_SUMUP
public static final String KEY_SUMUP
- The list of names of stop watches to add.
- See Also:
- Constant Field Values
wish
private List wish
- The list of watches we want.
watches
private List watches
- The list of truely registered watches.
SumWatch
public SumWatch(Map prop)
- Constructs a new observation time. It is not started or stopped itself,
it merely adds individual stop watch times to a total time.
init
public void init()
- Initializes the list of requested watches. After registering, all of
the watches should have been added, otherwise a warning is issued.
- Specified by:
init in interface Initializable- Overrides:
init in class AbstractParameter
rescanned
public double rescanned(String key,
String old,
String newval)
- Exception, if watches change.
- Specified by:
rescanned in interface Reloadable- Overrides:
rescanned in class AbstractParameter
afterAll
public void afterAll()
- If we have still some watches left that have not been registered,
yell now.
- Specified by:
afterAll in interface AfterRegistering
registerParameter
public void registerParameter(Parameter part)
- Registers a new stop watch to this parameter. Only if it is listed
in
KEY_SUMUP and has not already been registered, the watch
is added.
- Specified by:
registerParameter in interface ParameterDepending
setValue
public Number setValue(Number val)
throws UnsupportedOperationException
- Sets the current total time. This is a read-only variable,
therefore this method throws an UnsupportedOperationException.
- Specified by:
setValue in interface Value
- Throws:
UnsupportedOperationException
getValue
public Number getValue()
- Sums all watches and returns their values.
- Specified by:
getValue in interface Value