public class ManualActionEngine extends java.lang.Object implements ActionEngine
ActionEngine
. ManualActionEngine uses no additional
threads and will not run any actions until resume()
is called. When the engine is
ticking all jobs that should be executed will be (even if past their estimated schedule time).Modifier and Type | Class and Description |
---|---|
class |
ManualActionEngine.ManualContext<T>
Manual action context.
|
Constructor and Description |
---|
ManualActionEngine()
Creates a new instance of ManualActionEngine.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
addWork(ManualActionEngine.ManualContext<?> context)
Adds work to the engine.
|
ActionBindings |
getBindings()
Bindings for this engine.
|
protected ManualWorkQueue<ManualActionEngine.ManualContext<?>> |
getWorkQueue()
Gets the engine's work queue.
|
boolean |
isPaused()
Whether the engine is paused.
|
boolean |
isStopped()
Whether the engine is stopped.
|
<T> ManualActionEngine.ManualContext<T> |
newContext(Action<T> action)
Creates an action context to define how the action will be scheduled for execution.
|
void |
pause()
Pauses action processing.
|
protected boolean |
removeWork(ManualActionEngine.ManualContext<?> context)
Removes work from the engine.
|
void |
resume()
Resumes performing actions.
|
void |
stop()
Permanently stops the engine.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
putInBindings, removeFromBindings, schedule, schedule
public ManualActionEngine()
protected boolean addWork(ManualActionEngine.ManualContext<?> context)
context
- Work to add.Actions.requireNotStopped(ActionEngine)
public ActionBindings getBindings()
ActionEngine
getBindings
in interface ActionEngine
protected ManualWorkQueue<ManualActionEngine.ManualContext<?>> getWorkQueue()
public boolean isPaused()
ActionEngine
isPaused
in interface ActionEngine
public boolean isStopped()
ActionEngine
isStopped
in interface ActionEngine
public <T> ManualActionEngine.ManualContext<T> newContext(Action<T> action)
ActionEngine
newContext
in interface ActionEngine
action
- Action to create context for.public void pause()
ActionEngine
pause
in interface ActionEngine
protected boolean removeWork(ManualActionEngine.ManualContext<?> context)
context
- Work to remove.public void resume()
ActionEngine
resume
in interface ActionEngine
public void stop()
ActionEngine
stop
in interface ActionEngine