Opus5
Interface PriorityQueue

All Superinterfaces:
Comparable, Container
All Known Subinterfaces:
DoubleEndedPriorityQueue, MergeablePriorityQueue
All Known Implementing Classes:
BinaryHeap

public interface PriorityQueue
extends Container

Encapsulates methods common to all priority queues.

Version:
$Id: PriorityQueue.java,v 3.1 1998/07/28 01:32:17 brpreiss Exp $
Author:
Bruno R. Preiss, P.Eng.

Field Summary
static java.lang.String copyright
           
 
Method Summary
 Comparable dequeueMin()
          Dequeues and returns the "smallest" object in this priority queue.
 void enqueue(Comparable object)
          Enqueues the specified object in this priority queue.
 Comparable findMin()
          Returns the "smallest" object in this priority queue.
 
Methods inherited from interface Opus5.Container
accept, getCount, getEnumeration, isEmpty, isFull, purge
 
Methods inherited from interface Opus5.Comparable
compare, isEQ, isGE, isGT, isLE, isLT, isNE
 

Field Detail

copyright

public static final java.lang.String copyright
Method Detail

enqueue

public void enqueue(Comparable object)
Enqueues the specified object in this priority queue.
Parameters:
object - The object to be enqueued.
Throws:
ContainerFullException - If the queue is full.

findMin

public Comparable findMin()
Returns the "smallest" object in this priority queue. The smallest item in a priority queue is the one that is smaller than all the rest.
Returns:
The smallest object in this priority queue.
Throws:
ContainerEmptyException - If the priority queue is empty.

dequeueMin

public Comparable dequeueMin()
Dequeues and returns the "smallest" object in this priority queue. The smallest item in a priority queue is the one that is smaller than all the rest.
Returns:
The smallest object in this priority queue.
Throws:
ContainerEmptyException - If the priority queue is empty.