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.

See Also:
EmptyContainerException, InvalidKeyException, Comparator, PriorityQueue

Method Index

 o insertItem(Object, Object)
Insert an item (key-element pair).
 o minElement()
Inspect an element (not a key) with smallest key, without modifying the priority queue.
 o minKey()
Inspect a smallest key (not its element), without modifying the priority queue.
 o removeMinElement()
Remove an item (key,element) with smallest key.

Methods

 o 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.
 o 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.
 o 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.
 o 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