|
||||||||||
| 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.WatchController
public abstract class WatchController
A watch-controller is a super-class for instances that control a set of
RollOverWatches. It is a parameter that registers additional
parameters that are instances of RollOverWatch, if they are
accepted with the KEY_ACCEPT. A roll-over watch is accepted, if
it's flavour matches this controller's KEY_ACCEPT key.
Note that all roll-over
watches are reset initially at a date derived from the KEY_COARSE
and the KEY_T0 properties in a way that the first roll-over date is
that that minizes the integer n in
f(t) = n*coarse+t0-t,with f(t)>0. E.g. if the
KEY_COARSE points to 86400000 (ms) and
KEY_T0 to 2000-01-01 12:00:00, then the first roll-over will occur
on noon the next following day.
| Nested Class Summary | |
|---|---|
protected class |
WatchController.ResetTask
A timer task that simply resets the roll-over watch passed to it as a constructor argument. |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static long |
DEFCOARSE
The default coarseness. |
private static SimpleDateFormat |
DEFDATEFORMAT
The default date format to use. |
private static String |
DEFT0
The default date. |
static String |
KEY_ACCEPT
A key defining the flavour of roll-over watches to accept. |
static String |
KEY_COARSE
A key defining the coarseness of the first roll-over. |
static String |
KEY_DATEFORMAT
The date format to use with KEY_T0. |
static String |
KEY_T0
An offset for the first roll-over. |
private static Timer |
reset
The timer to controll roll-overs of registered watches. |
private List |
watches
The list of all roll-over watches controlled by this controller. |
| 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 |
WatchController(Map prop)
Constructs a new watch controller. |
| Method Summary | |
|---|---|
void |
afterAll()
Initializes this watch controllers. |
protected List |
getWatches()
Returns all the roll-over watches served by this parameter. |
void |
registerParameter(Parameter iswatch)
Registers an additional parameter. |
protected double |
rescanned(String key,
String old,
String newval)
We throw an exception if the watches changed. |
| Methods inherited from class stella.parameter.AbstractParameter |
|---|
createParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, init, register, 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.Parameter |
|---|
get, getFormatted, getName, getString, set |
| 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_ACCEPT
public static final String KEY_COARSE
public static final String KEY_T0
KEY_DATEFORMAT.
public static final String KEY_DATEFORMAT
KEY_T0.
private static final long DEFCOARSE
private static final String DEFT0
private static final SimpleDateFormat DEFDATEFORMAT
private List watches
private static Timer reset
| Constructor Detail |
|---|
protected WatchController(Map prop)
KEY_COARSE, the
KEY_T0 and the KEY_DATEFORMAT properties asume their
default values if not specified.
| Method Detail |
|---|
protected double rescanned(String key,
String old,
String newval)
rescanned in class AbstractParameterpublic void afterAll()
watches
is scheduled-at-fixed-rate to reset each
RollOverWatch.getRollOverTime(), starting at a date defined with
KEY_COARSE and KEY_T0.
Note that a roll-over time of zero means no roll-over
at all, not even an initial roll-over.
afterAll in interface AfterRegisteringpublic void registerParameter(Parameter iswatch)
KEY_ACCEPT matches the flavour of the watch, it is reset by
this watch controller every RollOverWatch.getRollOverTime(),
starting at a date defined by KEY_COARSE and
KEY_T0. Note that a roll-over time of zero means no roll-over
at all, not even an initial roll-over.
registerParameter in interface ParameterDependingprotected List getWatches()
RollOverWatch instances.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||