Queue is a definition of a data structure that may
act as a queue - that is, data can be added to one end of the
queue and data can be requested from the head end of the queue.
This class is thread safe for multiple producers and a single
consumer. The next() method will block until there is data in
the queue.
This has now been modified so that it is compatible with
the earlier JDK1.1 in order to be suitable for running on
mobile appliances. This means replacing the LinkedList with
a Vector, which is hardly ideal, but this Queue is typically
only polled every second before dispatching messages.
Returns the Object at the front of the Queue. This
Object is then removed from the Queue. If the Queue
is empty, then this method shall block until there
is an Object in the Queue to return.
Returns:
The next item from the front of the queue.
hasNext
public boolean hasNext()
Returns true if the Queue is not empty. If another
Thread empties the Queue before next() is
called, then the call to next() shall block
until the Queue has been populated again.