org.apache.commons.collections
Interface PriorityQueue
- BinaryHeap, SynchronizedPriorityQueue
public interface PriorityQueue
Defines a collection for priority queues, which can insert, peek and pop.
This interface is now replaced by the
Buffer
interface.
$Revision: 1.14 $ $Date: 2004/02/18 01:15:42 $ 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.
|
clear
public void clear()
Clear all elements from queue.
insert
public void insert(Object element)
Insert an element into queue.
element
- the element to be inserted
isEmpty
public boolean isEmpty()
Test if queue is empty.
- true if queue is empty else false.
peek
public Object peek()
Return element on top of heap but don't remove it.
- the element at top of heap
pop
public Object pop()
Return element on top of heap and remove it.
- the element at top of heap
Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.