org.apache.tomcat.util.collections
Class Queue
java.lang.Object
org.apache.tomcat.util.collections.Queue
public class Queue
extends java.lang.Object
A simple FIFO queue class which causes the calling thread to wait
if the queue is empty and notifies threads that are waiting when it
is not empty.
- Anil V (akv@eng.sun.com)
Object | get() - Get the first object out of the queue.
|
boolean | isEmpty() - Is the queue empty?
|
Object | peek() - Peek to see if something is available.
|
Object | pull() - Pull the first object out of the queue.
|
void | put(Object object) - Put the object into the queue.
|
int | size() - How many elements are there in this queue?
|
void | stop() - Break the pull(), allowing the calling thread to exit
|
get
public Object get()
Get the first object out of the queue. Return null if the queue
is empty.
isEmpty
public boolean isEmpty()
Is the queue empty?
peek
public Object peek()
Peek to see if something is available.
pull
public Object pull()
Pull the first object out of the queue. Wait if the queue is
empty.
put
public void put(Object object)
Put the object into the queue.
object
- the object to be appended to the
queue.
size
public int size()
How many elements are there in this queue?
stop
public void stop()
Break the pull(), allowing the calling thread to exit
Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.