public class WebTimer extends Object implements Serializable
Timer,
TimerActionListener,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected String |
actionCommand
Action command for fired events.
|
protected boolean |
coalesce
Whether each action should be fired from a separate invoke and wait call or not.
|
protected int |
cycleCount
Number of executed cycles;
|
protected int |
cyclesLimit
Timer cycles execution limit.
|
static int |
defaultCyclesLimit
Default cycles number limit.
|
static String |
defaultThreadName
Default name for timer thread.
|
protected long |
delay
Delay between timer cycles in milliseconds.
|
protected Thread |
exec
Last timer thread.
|
protected int |
id
Unique (within one timer instance) ID of currently running thread.
|
protected long |
initialDelay
Delay before the first timer cycle run in milliseconds.
|
protected int |
lastId
ID of previously executed thread.
|
protected EventListenerList |
listeners
Timer event listeners list.
|
protected String |
name
Internal timer thread name.
|
protected boolean |
nonBlockingStop
Whether or not timer should use non-blocking stop method behavior.
|
protected boolean |
repeats
Whether timer repeat its cycles or not.
|
protected Map<Integer,Boolean> |
running
Map of marks for currently active threads.
|
protected long |
sleepStart
Last timer cycle start time.
|
protected long |
sleepTime
Last timer cycle delay time.
|
protected boolean |
useDaemonThread
Whether should use daemon thread instead of user one or not.
|
static boolean |
useEdtByDefault
Whether EDT should be used as the default timer action execution thread.
|
protected boolean |
useEventDispatchThread
Whether actions should be fired from Event Dispatch Thread or not.
|
| Constructor and Description |
|---|
WebTimer(long delay)
Constructs timer with specified delay.
|
WebTimer(long delay,
ActionListener listener)
Constructs timer with specified delay and action listener.
|
WebTimer(long delay,
long initialDelay)
Constructs timer with specified delay and initial delay.
|
WebTimer(long delay,
long initialDelay,
ActionListener listener)
Constructs timer with specified delay, initial delay and action listener.
|
WebTimer(String delay)
Constructs timer with specified delay.
|
WebTimer(String delay,
ActionListener listener)
Constructs timer with specified delay and action listener.
|
WebTimer(String name,
long delay)
Constructs timer with specified internal thread name and delay.
|
WebTimer(String name,
long delay,
ActionListener listener)
Constructs timer with specified internal thread name, delay and action listener.
|
WebTimer(String name,
long delay,
long initialDelay)
Constructs timer with specified internal thread name, delay and initial delay.
|
WebTimer(String name,
long delay,
long initialDelay,
ActionListener listener)
Constructs timer with specified internal thread name, delay, initial delay and action listener.
|
WebTimer(String name,
String delay)
Constructs timer with specified internal thread name and delay.
|
WebTimer(String name,
String delay,
ActionListener listener)
Constructs timer with specified internal thread name, delay and action listener.
|
WebTimer(String name,
String delay,
String initialDelay,
ActionListener listener)
Constructs timer with specified internal thread name, delay, initial delay and action listener.
|
| Modifier and Type | Method and Description |
|---|---|
WebTimer |
addActionListener(ActionListener listener)
Adds new action listener.
|
protected void |
cleanUp(int id)
Cleans thread ID cache.
|
protected ActionEvent |
createActionEvent()
Returns action event.
|
static WebTimer |
delay(long delay,
ActionListener listener)
Returns newly created and started timer that doesn't repeat and has the specified delay and action listener.
|
static WebTimer |
delay(long delay,
boolean useEventDispatchThread,
ActionListener listener)
Returns newly created and started timer that doesn't repeat and has the specified delay and action listener.
|
static WebTimer |
delay(String delay,
ActionListener listener)
Returns newly created and started timer that doesn't repeat and has the specified delay and action listener.
|
static WebTimer |
delay(String delay,
boolean useEventDispatchThread,
ActionListener listener)
Returns newly created and started timer that doesn't repeat and has the specified delay and action listener.
|
static WebTimer |
delay(String name,
long delay,
ActionListener listener)
Returns newly created and started timer that doesn't repeat and has the specified delay and action listener.
|
static WebTimer |
delay(String name,
long delay,
boolean useEventDispatchThread,
ActionListener listener)
Returns newly created and started timer that doesn't repeat and has the specified delay and action listener.
|
static WebTimer |
delay(String name,
String delay,
ActionListener listener)
Returns newly created and started timer that doesn't repeat and has the specified delay and action listener.
|
static WebTimer |
delay(String name,
String delay,
boolean useEventDispatchThread,
ActionListener listener)
Returns newly created and started timer that doesn't repeat and has the specified delay and action listener.
|
void |
fireActionPerformed(int id)
Fires action events.
|
String |
getActionCommand()
Returns action command for fired events.
|
int |
getCycleCount()
Returns executed cycles count.
|
int |
getCycleNumber()
Returns current cycle number.
|
int |
getCyclesLimit()
Returns timer cycles execution limit.
|
long |
getCycleTimeLeft()
Returns time left in milliseconds until current cycle action execution.
|
long |
getCycleTimePassed()
Returns time passed in milliseconds since current cycle start.
|
long |
getDelay()
Returns delay between timer cycles in milliseconds.
|
long |
getInitialDelay()
Returns delay before the first timer cycle run in milliseconds.
|
String |
getInitialStringDelay()
Returns delay before the first timer cycle run.
|
List<ActionListener> |
getListeners()
Returns available action listeners list.
|
String |
getName()
Returns internal timer thread name.
|
String |
getStringDelay()
Returns delay between timer cycles.
|
boolean |
isCoalesce()
Returns whether each action should be fired from a separate invoke and wait call or not.
|
boolean |
isLastCycle()
Return whether last cycle execution is ongoing or not.
|
boolean |
isNonBlockingStop()
Returns whether or not timer should use non-blocking stop method behavior.
|
boolean |
isRepeats()
Returns whether timer repeat its cycles or not.
|
boolean |
isRunning()
Returns whether this
WebTimer is running or not. |
boolean |
isUseDaemonThread()
Returns whether should use daemon thread instead of user one or not.
|
boolean |
isUseEventDispatchThread()
Returns whether actions should be fired from Event Dispatch Thread or not.
|
WebTimer |
removeActionListener(ActionListener listener)
Removes an action listener.
|
static WebTimer |
repeat(boolean useDaemonThread,
String name,
long delay,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener.
|
static WebTimer |
repeat(boolean useDaemonThread,
String name,
long delay,
long initialDelay,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener.
|
static WebTimer |
repeat(boolean useDaemonThread,
String name,
long delay,
long initialDelay,
int cyclesLimit,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener.
|
static WebTimer |
repeat(long delay,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener.
|
static WebTimer |
repeat(long delay,
boolean useEventDispatchThread,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener.
|
static WebTimer |
repeat(long delay,
int cyclesLimit,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener.
|
static WebTimer |
repeat(long delay,
int cyclesLimit,
boolean useEventDispatchThread,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener.
|
static WebTimer |
repeat(long delay,
long initialDelay,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener.
|
static WebTimer |
repeat(long delay,
long initialDelay,
boolean useEventDispatchThread,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener.
|
static WebTimer |
repeat(long delay,
long initialDelay,
int cyclesLimit,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener.
|
static WebTimer |
repeat(long delay,
long initialDelay,
int cyclesLimit,
boolean useEventDispatchThread,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener.
|
static WebTimer |
repeat(String delay,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener.
|
static WebTimer |
repeat(String delay,
boolean useEventDispatchThread,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener.
|
static WebTimer |
repeat(String delay,
int cyclesLimit,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener.
|
static WebTimer |
repeat(String delay,
int cyclesLimit,
boolean useEventDispatchThread,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener.
|
static WebTimer |
repeat(String name,
long delay,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener.
|
static WebTimer |
repeat(String name,
long delay,
boolean useEventDispatchThread,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener.
|
static WebTimer |
repeat(String name,
long delay,
int cyclesLimit,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener.
|
static WebTimer |
repeat(String name,
long delay,
int cyclesLimit,
boolean useEventDispatchThread,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener.
|
static WebTimer |
repeat(String name,
long delay,
long initialDelay,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener.
|
static WebTimer |
repeat(String name,
long delay,
long initialDelay,
boolean useEventDispatchThread,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener.
|
static WebTimer |
repeat(String name,
long delay,
long initialDelay,
int cyclesLimit,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener.
|
static WebTimer |
repeat(String name,
long delay,
long initialDelay,
int cyclesLimit,
boolean useEventDispatchThread,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener.
|
static WebTimer |
repeat(String name,
String delay,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener.
|
static WebTimer |
repeat(String name,
String delay,
boolean useEventDispatchThread,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener.
|
static WebTimer |
repeat(String name,
String delay,
int cyclesLimit,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener.
|
static WebTimer |
repeat(String name,
String delay,
int cyclesLimit,
boolean useEventDispatchThread,
ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener.
|
WebTimer |
restart()
Restarts timer execution.
|
WebTimer |
restart(long delay)
Restarts timer execution and modifies timer delay.
|
WebTimer |
restart(long initialDelay,
long delay)
Restarts timer execution and modifies timer delays.
|
WebTimer |
restart(String delay)
Restarts timer execution and modifies timer delay.
|
WebTimer |
restart(String initialDelay,
String delay)
Restarts timer execution and modifies timer delays.
|
WebTimer |
setActionCommand(String actionCommand)
Sets action command for fired events.
|
protected void |
setAlive(int id,
boolean alive)
Sets whether thread under specified ID is alive or not.
|
WebTimer |
setCoalesce(boolean coalesce)
Sets whether each action should be fired from a separate invoke and wait call or not.
|
WebTimer |
setCyclesLimit(int cyclesLimit)
Sets timer cycles execution limit.
|
WebTimer |
setDelay(long delay)
Sets delay between timer cycles in milliseconds.
|
WebTimer |
setDelay(String delay)
Sets delay between timer cycles.
|
WebTimer |
setInitialDelay(long initialDelay)
Sets delay before the first timer cycle run in milliseconds.
|
WebTimer |
setInitialDelay(String initialDelay)
Sets delay before the first timer cycle run.
|
WebTimer |
setName(String name)
Sets internal timer thread name.
|
WebTimer |
setNonBlockingStop(boolean nonBlockingStop)
Sets whether or not timer should use non-blocking stop method behavior.
|
WebTimer |
setRepeats(boolean repeats)
Sets whether timer should repeat its cycles or not.
|
WebTimer |
setUseDaemonThread(boolean useDaemonThread)
Returns whether should use daemon thread instead of user one or not.
|
WebTimer |
setUseEventDispatchThread(boolean useEventDispatchThread)
Sets whether actions should be fired from Event Dispatch Thread or not.
|
protected boolean |
shouldContinue(int cycle,
int id)
Returns whether thread with specified ID should continue execution or not.
|
WebTimer |
start()
Starts timer execution.
|
protected void |
startExec()
Starts timer execution thread.
|
WebTimer |
stop()
Stops timer execution.
|
protected void |
stopExec()
Stops timer execution.
|
String |
toString() |
public static String defaultThreadName
public static int defaultCyclesLimit
public static boolean useEdtByDefault
protected long delay
protected long initialDelay
protected boolean repeats
protected boolean coalesce
protected boolean useEventDispatchThread
protected boolean useDaemonThread
protected boolean nonBlockingStop
protected int cyclesLimit
protected final EventListenerList listeners
protected transient int id
protected transient int lastId
@NotNull protected final transient Map<Integer,Boolean> running
protected transient long sleepStart
protected transient long sleepTime
protected transient int cycleCount
public WebTimer(@NotNull String delay)
delay - delay between timer cyclespublic WebTimer(long delay)
delay - delay between timer cycles in millisecondspublic WebTimer(@NotNull String name, @NotNull String delay)
name - internal thread namedelay - delay between timer cyclespublic WebTimer(@NotNull String name, long delay)
name - internal thread namedelay - delay between timer cycles in millisecondspublic WebTimer(long delay,
long initialDelay)
delay - delay between timer cycles in millisecondsinitialDelay - delay before the first timer cycle run in millisecondspublic WebTimer(@NotNull String name, long delay, long initialDelay)
name - internal thread namedelay - delay between timer cycles in millisecondsinitialDelay - delay before the first timer cycle run in millisecondspublic WebTimer(@NotNull String delay, @Nullable ActionListener listener)
delay - delay between timer cycleslistener - action listenerpublic WebTimer(long delay,
@Nullable
ActionListener listener)
delay - delay between timer cycles in millisecondslistener - action listenerpublic WebTimer(@NotNull String name, @NotNull String delay, @Nullable ActionListener listener)
name - internal thread namedelay - delay between timer cycleslistener - action listenerpublic WebTimer(@NotNull String name, long delay, @Nullable ActionListener listener)
name - internal thread namedelay - delay between timer cycles in millisecondslistener - action listenerpublic WebTimer(long delay,
long initialDelay,
@Nullable
ActionListener listener)
delay - delay between timer cycles in millisecondsinitialDelay - delay before the first timer cycle run in millisecondslistener - action listenerpublic WebTimer(@NotNull String name, String delay, @NotNull String initialDelay, @Nullable ActionListener listener)
name - internal thread namedelay - delay between timer cyclesinitialDelay - delay before the first timer cycle runlistener - action listenerpublic WebTimer(@NotNull String name, long delay, long initialDelay, @Nullable ActionListener listener)
name - internal thread namedelay - delay between timer cycles in millisecondsinitialDelay - delay before the first timer cycle run in millisecondslistener - action listenerpublic long getInitialDelay()
@NotNull public String getInitialStringDelay()
@NotNull public WebTimer setInitialDelay(@NotNull String initialDelay)
initialDelay - delay before the first timer cycle runWebTimer@NotNull public WebTimer setInitialDelay(long initialDelay)
initialDelay - delay before the first timer cycle run in millisecondsWebTimerpublic long getDelay()
@NotNull public String getStringDelay()
@NotNull public WebTimer setDelay(@NotNull String delay)
delay - delay between timer cyclesWebTimer@NotNull public WebTimer setDelay(long delay)
delay - delay between timer cycles in millisecondsWebTimerpublic boolean isRepeats()
@NotNull public WebTimer setRepeats(boolean repeats)
repeats - whether timer should repeat its cycles or notWebTimerpublic boolean isCoalesce()
@NotNull public WebTimer setCoalesce(boolean coalesce)
coalesce - whether each action should be fired from a separate invoke and wait call or notWebTimerpublic boolean isUseEventDispatchThread()
@NotNull public WebTimer setUseEventDispatchThread(boolean useEventDispatchThread)
useEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notWebTimerpublic boolean isUseDaemonThread()
@NotNull public WebTimer setUseDaemonThread(boolean useDaemonThread)
useDaemonThread - whether should use daemon thread instead of user one or notWebTimerpublic boolean isNonBlockingStop()
@NotNull public WebTimer setNonBlockingStop(boolean nonBlockingStop)
nonBlockingStop - whether or not timer should use non-blocking stop method behaviorWebTimer@NotNull public String getActionCommand()
@NotNull public WebTimer setActionCommand(@NotNull String actionCommand)
actionCommand - action command for fired eventsWebTimerpublic int getCyclesLimit()
@NotNull public WebTimer setCyclesLimit(int cyclesLimit)
cyclesLimit - timer cycles execution limitWebTimer@NotNull public String getName()
@NotNull public WebTimer setName(@NotNull String name)
name - internal timer thread nameWebTimerpublic long getCycleTimePassed()
public long getCycleTimeLeft()
public int getCycleCount()
public int getCycleNumber()
public boolean isLastCycle()
@NotNull public WebTimer restart(long delay)
delay - delay between timer cyclesWebTimer@NotNull public WebTimer restart(long initialDelay, long delay)
initialDelay - delay before the first timer cycle rundelay - delay between timer cyclesWebTimer@NotNull public WebTimer restart(@NotNull String delay)
delay - delay between timer cyclesWebTimer@NotNull public WebTimer restart(@NotNull String initialDelay, @NotNull String delay)
initialDelay - delay before the first timer cycle rundelay - delay between timer cyclesWebTimerpublic boolean isRunning()
WebTimer is running or not.true if this WebTimer is running, false otherwiseprotected void startExec()
protected boolean shouldContinue(int cycle,
int id)
cycle - cycle numberid - execution thread IDprotected void setAlive(int id,
boolean alive)
id - thread IDalive - whether thread is alive or notprotected void cleanUp(int id)
id - thread IDprotected void stopExec()
@NotNull public WebTimer addActionListener(@NotNull ActionListener listener)
listener - new action listenerWebTimer@NotNull public WebTimer removeActionListener(@NotNull ActionListener listener)
listener - action listenerWebTimer@NotNull public List<ActionListener> getListeners()
public void fireActionPerformed(int id)
id - execution thread ID@NotNull protected ActionEvent createActionEvent()
public static WebTimer delay(@NotNull String delay, @Nullable ActionListener listener)
delay - delay between timer cycleslistener - action listenerpublic static WebTimer delay(long delay, @Nullable ActionListener listener)
delay - delay between timer cycles in millisecondslistener - action listenerpublic static WebTimer delay(@NotNull String name, @NotNull String delay, @Nullable ActionListener listener)
name - thread namedelay - delay between timer cycleslistener - action listenerpublic static WebTimer delay(@NotNull String name, long delay, @Nullable ActionListener listener)
name - thread namedelay - delay between timer cycles in millisecondslistener - action listenerpublic static WebTimer delay(@NotNull String delay, boolean useEventDispatchThread, @Nullable ActionListener listener)
delay - delay between timer cyclesuseEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notlistener - action listenerpublic static WebTimer delay(long delay, boolean useEventDispatchThread, @Nullable ActionListener listener)
delay - delay between timer cycles in millisecondsuseEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notlistener - action listenerpublic static WebTimer delay(@NotNull String name, @NotNull String delay, boolean useEventDispatchThread, @Nullable ActionListener listener)
name - thread namedelay - delay between timer cyclesuseEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notlistener - action listenerpublic static WebTimer delay(@NotNull String name, long delay, boolean useEventDispatchThread, @Nullable ActionListener listener)
name - thread namedelay - delay between timer cycles in millisecondsuseEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notlistener - action listenerpublic static WebTimer repeat(@NotNull String delay, @Nullable ActionListener listener)
delay - delay between timer cycleslistener - action listenerpublic static WebTimer repeat(@NotNull String delay, int cyclesLimit, @Nullable ActionListener listener)
delay - delay between timer cyclescyclesLimit - timer cycles execution limitlistener - action listenerpublic static WebTimer repeat(long delay, @Nullable ActionListener listener)
delay - delay between timer cycles in millisecondslistener - action listenerpublic static WebTimer repeat(long delay, int cyclesLimit, @Nullable ActionListener listener)
delay - delay between timer cycles in millisecondscyclesLimit - timer cycles execution limitlistener - action listenerpublic static WebTimer repeat(@NotNull String name, @NotNull String delay, @Nullable ActionListener listener)
name - thread namedelay - delay between timer cycleslistener - action listenerpublic static WebTimer repeat(@NotNull String name, String delay, int cyclesLimit, @Nullable ActionListener listener)
name - thread namedelay - delay between timer cyclescyclesLimit - timer cycles execution limitlistener - action listenerpublic static WebTimer repeat(@NotNull String name, long delay, @Nullable ActionListener listener)
name - thread namedelay - delay between timer cycles in millisecondslistener - action listenerpublic static WebTimer repeat(@NotNull String name, long delay, int cyclesLimit, @Nullable ActionListener listener)
name - thread namedelay - delay between timer cycles in millisecondscyclesLimit - timer cycles execution limitlistener - action listenerpublic static WebTimer repeat(@NotNull String delay, boolean useEventDispatchThread, @Nullable ActionListener listener)
delay - delay between timer cyclesuseEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notlistener - action listenerpublic static WebTimer repeat(@NotNull String delay, int cyclesLimit, boolean useEventDispatchThread, @Nullable ActionListener listener)
delay - delay between timer cyclescyclesLimit - timer cycles execution limituseEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notlistener - action listenerpublic static WebTimer repeat(long delay, boolean useEventDispatchThread, @Nullable ActionListener listener)
delay - delay between timer cycles in millisecondsuseEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notlistener - action listenerpublic static WebTimer repeat(long delay, int cyclesLimit, boolean useEventDispatchThread, @Nullable ActionListener listener)
delay - delay between timer cycles in millisecondscyclesLimit - timer cycles execution limituseEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notlistener - action listenerpublic static WebTimer repeat(@NotNull String name, @NotNull String delay, boolean useEventDispatchThread, @Nullable ActionListener listener)
name - thread namedelay - delay between timer cyclesuseEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notlistener - action listenerpublic static WebTimer repeat(@NotNull String name, @NotNull String delay, int cyclesLimit, boolean useEventDispatchThread, @Nullable ActionListener listener)
name - thread namedelay - delay between timer cyclescyclesLimit - timer cycles execution limituseEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notlistener - action listenerpublic static WebTimer repeat(@NotNull String name, long delay, boolean useEventDispatchThread, @Nullable ActionListener listener)
name - thread namedelay - delay between timer cycles in millisecondsuseEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notlistener - action listenerpublic static WebTimer repeat(@NotNull String name, long delay, int cyclesLimit, boolean useEventDispatchThread, @Nullable ActionListener listener)
name - thread namedelay - delay between timer cycles in millisecondscyclesLimit - timer cycles execution limituseEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notlistener - action listenerpublic static WebTimer repeat(long delay, long initialDelay, @Nullable ActionListener listener)
delay - delay between timer cycles in millisecondsinitialDelay - delay before the first timer cycle run in millisecondslistener - action listenerpublic static WebTimer repeat(long delay, long initialDelay, int cyclesLimit, @Nullable ActionListener listener)
delay - delay between timer cycles in millisecondsinitialDelay - delay before the first timer cycle run in millisecondscyclesLimit - timer cycles execution limitlistener - action listenerpublic static WebTimer repeat(@NotNull String name, long delay, long initialDelay, @Nullable ActionListener listener)
name - thread namedelay - delay between timer cycles in millisecondsinitialDelay - delay before the first timer cycle run in millisecondslistener - action listenerpublic static WebTimer repeat(@NotNull String name, long delay, long initialDelay, int cyclesLimit, @Nullable ActionListener listener)
name - thread namedelay - delay between timer cycles in millisecondsinitialDelay - delay before the first timer cycle run in millisecondscyclesLimit - timer cycles execution limitlistener - action listenerpublic static WebTimer repeat(long delay, long initialDelay, boolean useEventDispatchThread, @Nullable ActionListener listener)
delay - delay between timer cycles in millisecondsinitialDelay - delay before the first timer cycle run in millisecondsuseEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notlistener - action listenerpublic static WebTimer repeat(long delay, long initialDelay, int cyclesLimit, boolean useEventDispatchThread, @Nullable ActionListener listener)
delay - delay between timer cycles in millisecondsinitialDelay - delay before the first timer cycle run in millisecondscyclesLimit - timer cycles execution limituseEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notlistener - action listenerpublic static WebTimer repeat(@NotNull String name, long delay, long initialDelay, boolean useEventDispatchThread, @Nullable ActionListener listener)
name - thread namedelay - delay between timer cycles in millisecondsinitialDelay - delay before the first timer cycle run in millisecondsuseEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notlistener - action listenerpublic static WebTimer repeat(@NotNull String name, long delay, long initialDelay, int cyclesLimit, boolean useEventDispatchThread, @Nullable ActionListener listener)
name - thread namedelay - delay between timer cycles in millisecondsinitialDelay - delay before the first timer cycle run in millisecondscyclesLimit - timer cycles execution limituseEventDispatchThread - whether actions should be fired from Event Dispatch Thread or notlistener - action listenerpublic static WebTimer repeat(boolean useDaemonThread, @NotNull String name, long delay, @Nullable ActionListener listener)
useDaemonThread - whether should use daemon thread instead of user one or notname - thread namedelay - delay between timer cycles in millisecondslistener - action listenerpublic static WebTimer repeat(boolean useDaemonThread, @NotNull String name, long delay, long initialDelay, @Nullable ActionListener listener)
useDaemonThread - whether should use daemon thread instead of user one or notname - thread namedelay - delay between timer cycles in millisecondsinitialDelay - delay before the first timer cycle run in millisecondslistener - action listenerpublic static WebTimer repeat(boolean useDaemonThread, @NotNull String name, long delay, long initialDelay, int cyclesLimit, @Nullable ActionListener listener)
useDaemonThread - whether should use daemon thread instead of user one or notname - thread namedelay - delay between timer cycles in millisecondsinitialDelay - delay before the first timer cycle run in millisecondscyclesLimit - timer cycles execution limitlistener - action listenerCopyright © 2020. All rights reserved.