org.apache.commons.collections
public interface PriorityQueue
Deprecated: Replaced by the Buffer interface and implementations in buffer subpackage. Due to be removed in v4.0.
Defines a collection for priority queues, which can insert, peek and pop.
This interface is now replaced by the Buffer
interface.
Since: Commons Collections 1.0
Version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
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.
|
Parameters: element the element to be inserted
Throws: ClassCastException if the specified element
's
type prevents it from being compared to other items in the queue to
determine its relative priority.
Returns: true if queue is empty else false.
Returns: the element at top of heap
Throws: java.util.NoSuchElementException if isEmpty() == true
Returns: the element at top of heap
Throws: java.util.NoSuchElementException if isEmpty() == true