Package org.gvsig.utils
Class Queue
java.lang.Object
org.gvsig.utils.Queue
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.
- Author:
- Anil V (akv@eng.sun.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()Get the first object out of the queue.booleanisEmpty()Is the queue empty?peek()Peek to see if something is available.pull()Pull the first object out of the queue.voidPut the object into the queue.intsize()How many elements are there in this queue?
-
Constructor Details
-
Queue
public Queue()
-
-
Method Details
-
put
Put the object into the queue.- Parameters:
object- the object to be appended to the queue.
-
pull
Pull the first object out of the queue. Wait if the queue is empty. -
get
Get the first object out of the queue. Return null if the queue is empty. -
peek
Peek to see if something is available. -
isEmpty
public boolean isEmpty()Is the queue empty? -
size
public int size()How many elements are there in this queue?
-