|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kalmeo.util.worker.Worker
public class Worker
Field Summary | |
---|---|
static Worker |
instance
|
Constructor Summary | |
---|---|
Worker()
|
Method Summary | |
---|---|
int |
getFrameDuration()
|
boolean |
isCurrentThread()
|
boolean |
isRunning()
|
void |
pushTask(WorkerTask task)
Push a task to th worker task list. |
void |
removeAllTasks()
Remove all instances of WorkerTask from task list. |
boolean |
removeTask(WorkerTask task)
Remove the first instance of a WorkerTask instance from task list |
void |
run()
|
void |
setFrameDuration(int frameDuration)
|
void |
setWorkerErrorListener(WorkerErrorListener workerErrorListener)
|
void |
start()
Start the worker |
void |
stop()
Stop the worker |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Worker instance
Constructor Detail |
---|
public Worker()
Method Detail |
---|
public void setWorkerErrorListener(WorkerErrorListener workerErrorListener)
workerErrorListener
- public boolean isCurrentThread()
true
if the current Thread is the Worker
threadpublic boolean isRunning()
public int getFrameDuration()
public void setFrameDuration(int frameDuration)
frameDuration
- the frameDuration to set in millisecondspublic void pushTask(WorkerTask task)
task
- public boolean removeTask(WorkerTask task)
WorkerTask
instance from task list
task
-
true
if the task is correctly removedpublic void removeAllTasks()
WorkerTask
from task list. The action is
possible only if the worker is not running.
public void start()
public void stop()
public void run()
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |