org.apache.commons.collections
public final class SynchronizedPriorityQueue extends Object implements PriorityQueue
Deprecated: PriorityQueue is replaced by the Buffer interface, see buffer subpackage. Due to be removed in v4.0.
A thread safe version of the PriorityQueue. Provides synchronized wrapper methods for all the methods defined in the PriorityQueue interface.Since: Commons Collections 1.0
Version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
Field Summary | |
---|---|
protected PriorityQueue | m_priorityQueue
The underlying priority queue. |
Constructor Summary | |
---|---|
SynchronizedPriorityQueue(PriorityQueue priorityQueue)
Constructs a new synchronized priority queue.
|
Method Summary | |
---|---|
void | clear()
Clear all elements from queue. |
void | insert(Object element)
Insert an element into queue.
|
boolean | isEmpty()
Test if queue is empty.
|
Object | peek()
Return element on top of heap but don't remove it.
|
Object | pop()
Return element on top of heap and remove it.
|
String | toString()
Returns a string representation of the underlying queue.
|
Parameters: priorityQueue the priority queue to synchronize
Parameters: element the element to be inserted
Returns: true if queue is empty else false.
Returns: the element at top of heap
Throws: NoSuchElementException if isEmpty() == true
Returns: the element at top of heap
Throws: NoSuchElementException if isEmpty() == true
Returns: a string representation of the underlying queue