ti.swing
Class SwingQueue

java.lang.Object
  extended by ti.swing.SwingQueue

public class SwingQueue
extends java.lang.Object

A queue implementation with a enqueue(java.lang.Object) method and a blocking dequeue() method that is safe to call from the AWT event dispatch thread.

Version:
0.1
Author:
Rob Clark

Constructor Summary
SwingQueue()
          Class Constructor.
 
Method Summary
 java.lang.Object dequeue()
          Dequeue item from queue, blocking until object is enqueued if the queue is currently empty.
 void enqueue(java.lang.Object obj)
          Enqueue, potentially unblocking any threads that have called the dequeue() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingQueue

public SwingQueue()
Class Constructor.

Method Detail

enqueue

public void enqueue(java.lang.Object obj)
Enqueue, potentially unblocking any threads that have called the dequeue() method.

Parameters:
obj - the object to enqueue
See Also:
dequeue()

dequeue

public java.lang.Object dequeue()
Dequeue item from queue, blocking until object is enqueued if the queue is currently empty. If multiple threads call this method it is not defined which one will dequeue an entry first. It is guaranteed that objects will be dequeued in the same order they are enqueued.

Returns:
the dequeued object
See Also:
enqueue(java.lang.Object)