Class DelayedEvent
- java.lang.Object
-
- net.egartley.beyondorigins.core.threads.DelayedEvent
-
- All Implemented Interfaces:
java.lang.Runnable
public class DelayedEvent extends java.lang.Object implements java.lang.Runnable
-
-
Field Summary
Fields Modifier and Type Field Description double
duration
The amount of time to wait (in seconds)boolean
isRunning
private boolean
naturalStop
java.lang.Thread
thread
-
Constructor Summary
Constructors Constructor Description DelayedEvent(double duration)
Create a new delayed event, which will callonFinish()
after the specified amount of time
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
Cancel the delayed event, and kill its thread.void
fastForward()
CallonFinish()
now ("fast forward" through the delay)void
onFinish()
void
run()
void
start()
Starts the delayed event
-
-
-
Constructor Detail
-
DelayedEvent
public DelayedEvent(double duration)
Create a new delayed event, which will callonFinish()
after the specified amount of time- Parameters:
duration
- How long to wait, in seconds
-
-
Method Detail
-
start
public void start()
Starts the delayed event
-
cancel
public void cancel()
Cancel the delayed event, and kill its thread.onFinish()
is not called
-
fastForward
public void fastForward()
CallonFinish()
now ("fast forward" through the delay)
-
onFinish
public void onFinish()
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
-