public class SnapshotParameter extends AbstractParameter implements ParameterDepending, ErrorDependingParameter, Reloadable
stella.GlobalGrouping instance.PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_ERROR
The class name of the error that serves as a snapshot-trigger.
|
static String |
KEY_PARAMETER
The name of the parameter which value should be recorded on error.
|
private Object |
record
The value of the asociated parameter at time of snapshot.
|
private Parameter |
snapshot
The asociated parameter.
|
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_MAPSEPARATORNAMING_EXTENSIONCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
SnapshotParameter(Map<String,String> prop)
Constructs a new snapshot parameter.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
get()
Gets the last snapshot value.
|
Object |
getForError(ErrorEvent err)
Checks if the error received is of the type specified in the
KEY_ERROR property. |
private boolean |
myError(ErrorEvent err)
Returns true if we act on this error.
|
void |
registerError(ErrorEvent err)
Registers the error.
|
void |
registerParameter(Parameter watch)
Registers the asociated parameter which value should be recorded.
|
double |
rescanned(String key,
String old,
String newval)
As any parameter depending instance we fail if the parameter we depend
on is now a different one.
|
Object |
set(Object newval)
Sets the snapshot value.
|
createParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, init, overrideDefaultName, register, 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, stringPropertiesinitreloadpublic static final String KEY_PARAMETER
public static final String KEY_ERROR
private Parameter snapshot
private Object record
public double rescanned(String key, String old, String newval)
rescanned in interface Reloadablerescanned in class AbstractParameterpublic void registerParameter(Parameter watch)
KEY_PARAMETERregisterParameter in interface ParameterDependingpublic Object getForError(ErrorEvent err)
KEY_ERROR property. If so, the current value of the observed
parameter is returned, otherwise null is returned.getForError in interface ErrorDependingParameterpublic void registerError(ErrorEvent err)
#getFor method return a non-null value, the value of this
parameter is adjusted to reflect the value of the served parameter at
the time this error was registered.registerError in interface ErrorDependingParameterprivate boolean myError(ErrorEvent err)
public Object get()
KEY_ERROR was received since the watched parameter
registration, null is returned.