gzz.util
Class PriorityQueue

gzz.client.AbstractUpdateManager gzz.util.Background gzz.util.PriorityQueue ../../../Gzz_Background.gen.html#bggeneral bggeneral_small
java.lang.Object
  |
  +--gzz.util.PriorityQueue

public class PriorityQueue
extends java.lang.Object

A simple implementation of a priority queue, for background jobs. N.B. the current implementation is not the most efficient possible one, by far.

This class is not synchronized!


Constructor Summary
PriorityQueue()
           
 
Method Summary
 void add(java.lang.Object job, float priority)
          Add a job to run.
 java.lang.Object getAndRemoveLowest()
          Get the most important (with lowest numeric priority) job and remove it from this queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PriorityQueue

public PriorityQueue()
Method Detail

add

public void add(java.lang.Object job,
                float priority)
Add a job to run. If the job has already been added, set the priority to the lower value (more important) of the two.


getAndRemoveLowest

public java.lang.Object getAndRemoveLowest()
Get the most important (with lowest numeric priority) job and remove it from this queue.