harpoon.Util
Interface MaxPriorityQueue

All Superinterfaces:
Collection
All Known Implementing Classes:
BinHeapPriorityQueue

public interface MaxPriorityQueue
extends Collection

MaxPriorityQueue maintains a Collection of Objects, each with an associated priority. Implementations should make the peekMax and removeMax operations efficient. Implementations need not implement the Object-addition operations of the Collection interface, since they do not associate each added Object with a priority.

Version:
$Id: MaxPriorityQueue.java,v 1.2 2002/02/25 21:08:45 cananian Exp $
Author:
Felix S. Klock II <pnkfelix@mit.edu>

Method Summary
 Object deleteMax()
          Returns and removes the Object in this with the highest priority.
 void insert(Object item, int priority)
          Inserts item into this, assigning it priority priority.
 Object peekMax()
          Returns the Object in this with the highest priority.
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

insert

public void insert(Object item,
                   int priority)
Inserts item into this, assigning it priority priority.

Parameters:
item - Object being inserted
priority - Priority of item

peekMax

public Object peekMax()
Returns the Object in this with the highest priority.


deleteMax

public Object deleteMax()
Returns and removes the Object in this with the highest priority.