|
||||||||||
| 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.AbstractTrigger
stella.parameter.SimpleTrigger
stella.parameter.CountDownTrigger
public class CountDownTrigger
A trigger that has a nominal state, set by initboolean. If toggled (or set)
to the non-init case, it re-attains the original state at least after
the KEY_TOGGLETIME has passed. If this time is zero, it acts as
a normal trigger. If a time parameter is registered to this trigger, it is
used (allows for acceleration), otherwise the system time is used.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static boolean |
DEFINITBOOLEAN
The default initial state of this trigger. |
private static String |
DEFTIME
The default name of the time to use. |
private static long |
DEFTOGGLETIME
Per default we act as a simple trigger, with no reset. |
static String |
KEY_TIME
The name of the time parameter. |
static String |
KEY_TOGGLETIME
The time until we toggle to the original state. |
private long |
lasttrue
The last time this trigger became not-init. |
private Time |
time
The time parameter. |
| Fields inherited from class stella.parameter.SimpleTrigger |
|---|
KEY_INITBOOLEAN |
| 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 | |
|---|---|
CountDownTrigger(Map<String,String> prop)
Constructs a new counting trigger. |
|
| Method Summary | |
|---|---|
private long |
getCurrentTime()
If an individual time parameter was set in this trigger, we use its value, otherwise system time. |
Boolean |
getTrigger()
Gets the trigger value. |
boolean |
preserve()
Preserves the overall true time of the trigger. |
void |
registerParameter(Parameter p)
If parameter is a time and has the correct name, we use it, otherwise system time. |
boolean |
restore()
Initializes the trigger. |
void |
setToggleTime(long nutog)
Allows direct setting of the toggle time, i.e. |
Boolean |
setTrigger(Boolean newval)
Sets the trigger. |
| Methods inherited from class stella.parameter.SimpleTrigger |
|---|
getLastToggleTime, init, rescanned |
| Methods inherited from class stella.parameter.AbstractTrigger |
|---|
get, getElapsedToggleTime, isTrue, set, toggleTrigger |
| Methods inherited from class stella.parameter.AbstractParameter |
|---|
createParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, 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.ExitCleaning |
|---|
exit |
| Methods inherited from interface util.Reloadable |
|---|
reload |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Field Detail |
|---|
public static final String KEY_TOGGLETIME
public static final String KEY_TIME
private static final boolean DEFINITBOOLEAN
private static final long DEFTOGGLETIME
private static final String DEFTIME
private long lasttrue
private Time time
| Constructor Detail |
|---|
public CountDownTrigger(Map<String,String> prop)
#KEY_INIT value.
| Method Detail |
|---|
public void registerParameter(Parameter p)
registerParameter in interface ParameterDependingpublic boolean restore()
restore in interface Preservingpublic boolean preserve()
preserve in interface Preservingpublic void setToggleTime(long nutog)
public Boolean getTrigger()
getTrigger in interface TriggergetTrigger in class SimpleTriggerpublic Boolean setTrigger(Boolean newval)
KEY_TOGGLETIME we may return this non-init value. If the
trigger is set repeatedly to the non-init value, only the last setting
is considered for the time out, i.e. the count down restarts.
setTrigger in interface TriggersetTrigger in class SimpleTriggerprivate long getCurrentTime()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||