gzz.util
Class Background

gzz.client.AbstractUpdateManager gzz.util.Background gzz.util.PriorityQueue ../../../Gzz_Background.gen.html#bggeneral bggeneral_small
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
           
 
Constructor Summary
Background()
           
 
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
 

Field Detail

dbg

public static boolean dbg
Constructor Detail

Background

public Background()
Method Detail

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()