gzz.util
Class Background
java.lang.Object
|
+--gzz.util.Background
- public class Background
- extends java.lang.Object
Perform tasks in the background, in a queue.
E.g. loading images.
If a task needs to be run again and again, it can
add itself: while adding a task twice before it is run
a single time will not cause it
to run twice, a task adding itself while it is running
will run again.
Field Summary |
static boolean |
dbg
|
Method Summary |
void |
addTask(java.lang.Runnable r)
Add a new task to run with priority 0. |
void |
addTask(java.lang.Runnable r,
float priority)
Add a new task to be run in the background thread. |
static Background |
getDefaultInstance()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dbg
public static boolean dbg
Background
public Background()
addTask
public void addTask(java.lang.Runnable r,
float priority)
- Add a new task to be run in the background thread.
If the task has already been added, and has not
been started, the priority will be set to the lower number
(higher priority) of the two, but the task will only
be run once.
addTask
public void addTask(java.lang.Runnable r)
- Add a new task to run with priority 0.
getDefaultInstance
public static Background getDefaultInstance()