public abstract class RunningCount extends AbstractRemoteValue implements ErrorDependingParameter, StatePreserving
PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private long |
count
The exposure counter for this target.
|
DEFBIND, KEY_BINDKEY_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| Modifier | Constructor and Description |
|---|---|
protected |
RunningCount(Map<String,String> prop)
We are not allowed to change any properties.
|
| Modifier and Type | Method and Description |
|---|---|
Number |
getValue()
Returns the same object as
Parameter.get() but already cast into
a Number. |
void |
init()
We scout for a file that hold the last unique values.
|
protected long |
next()
Increases the counter by one, returns new result.
|
boolean |
preserve()
On exit, we save our current state if the serialize property is set.
|
boolean |
restore()
We restore our old value by reading the last date and target count from a
serialization file.
|
Number |
setValue(Number val)
Setting the running number is only allowed via a call to next, therefore
this method throws an UnsupportedOperationException.
|
get, setaddRmiListener, bindToRegistry, exit, isValid, remoteGet, removeRmiListener, rescanned, unbindFromRegistrycreateParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, 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, waitgetForError, registerErrordefaultBoolean, 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, stringPropertiesexitprotected RunningCount(Map<String,String> prop) throws RemoteException
RemoteExceptionpublic void init()
throws InitException
init in interface Initializableinit in class AbstractRemoteParameterInitExceptionpublic boolean restore()
restore in interface Preservingpublic boolean preserve()
preserve in interface Preservingpublic Number getValue()
ValueParameter.get() but already cast into
a Number. Primitive data types can directly be extracted from
this number without any further explicit casting.public Number setValue(Number val) throws UnsupportedOperationException
setValue in interface ValueUnsupportedOperationExceptionprotected long next()