All Packages Class Hierarchy This Package Previous Next Index
Interface jdsl.simple.api.SimplePriorityQueue
- public interface SimplePriorityQueue
- extends Container
Interface for a priority queue. A priority queue defines a
total order relation, usually induced by a comparator. A priority
queue stores a collection of items (each of which is a key-element
pair); it supports the insertion of items whose key in the domain
of the total order relation, and the access and removal of items
with smallest key.
This interface in the "simple" package
defines only the basic methods of a priority queue.
- Version:
- $Revision: 1.2 $, $Date: 1998/07/02 21:24:49 $
- Author:
- Michael T. Goodrich, Mark Handy, Roberto Tamassia
- See Also:
- EmptyContainerException, InvalidKeyException, Comparator, PriorityQueue
-
insertItem(Object, Object)
-
Insert an item (key-element pair).
-
minElement()
-
Inspect an element (not a key) with smallest key, without modifying the
priority queue.
-
minKey()
-
Inspect a smallest key (not its element), without modifying the
priority queue.
-
removeMinElement()
-
Remove an item (key,element) with smallest key.
minElement
public abstract Object minElement() throws EmptyContainerException
- Inspect an element (not a key) with smallest key, without modifying the
priority queue.
- Returns:
- element with smallest key.
- Throws: EmptyContainerException
- if the container is empty.
minKey
public abstract Object minKey() throws EmptyContainerException
- Inspect a smallest key (not its element), without modifying the
priority queue.
- Returns:
- a smallest key.
- Throws: EmptyContainerException
- if the container is empty.
insertItem
public abstract void insertItem(Object key,
Object element) throws InvalidKeyException
- Insert an item (key-element pair).
- Parameters:
- key - object.
- element - arbitrary object.
- Throws: InvalidKeyException
- is thrown if the key is not in the domain of
the total order relation.
removeMinElement
public abstract Object removeMinElement() throws EmptyContainerException
- Remove an item (key,element) with smallest key.
- Returns:
- element (not the key) of the removed item.
- Throws: InvalidKeyException
- is thrown if the key is not in the domain of
the total order relation.
All Packages Class Hierarchy This Package Previous Next Index