public class CountDownWatch extends StopWatch
StopWatch.start() method is
called without setting a setCountDown(long), it will start counting down
from the value KEY_COUNTDOWN. If the KEY_AUTOSTART
property is set, the count down will begin right after construction.
The value retrieved is always the remaining time.PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private long |
countdown
The count-down start value.
|
private static boolean |
DEFAUTOSTART
The default auto-start behaviour.
|
private static long |
DEFCOUNTDOWN
The default count-down value.
|
static String |
KEY_AUTOSTART
If true, the countdown starts after construction.
|
static String |
KEY_COUNTDOWN
The count-down value.
|
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_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
CountDownWatch(Map<String,String> prop)
Constructs a new count-down watch.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getCountDown()
Returns the starting value of the count down.
|
Number |
getValue()
Returns the current count-down value.
|
double |
rescanned(String key,
String old,
String newval)
If the countdown value changed or the autostart changed, we update the
count down value or start the watch.
|
void |
setCountDown(long newcount)
Sets a new count-down value.
|
getFormatted, isCounting, preserve, registerParameter, reset, restart, restore, setValue, start, stopget, setcreateParameter, delivers, exit, 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, waitdefaultBoolean, 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, stringPropertiesinitexitreloadpublic static final String KEY_COUNTDOWN
setCountDown(long).public static final String KEY_AUTOSTART
private static final long DEFCOUNTDOWN
private static final boolean DEFAUTOSTART
private long countdown
public CountDownWatch(Map<String,String> prop)
KEY_COUNTDOWN (DEFCOUNTDOWN if not given). If the
KEY_AUTOSTART property is true, the countdown starts right
after the construction phase.public double rescanned(String key, String old, String newval)
rescanned in interface Reloadablerescanned in class StopWatchpublic Number getValue()
countdown. Time is in ms.public void setCountDown(long newcount)
public long getCountDown()