net.datastructures
Interface PriorityQueue<K,V>

All Known Subinterfaces:
AdaptablePriorityQueue<K,V>
All Known Implementing Classes:
HeapAdaptablePriorityQueue, HeapPriorityQueue, SortedListAdaptablePriorityQueue, SortedListPriorityQueue

public interface PriorityQueue<K,V>

Interface for the priority queue ADT


Method Summary
 Entry<K,V> insert(K key, V value)
          Inserts a key-value pair and return the entry created.
 boolean isEmpty()
          Returns whether the priority queue is empty.
 Entry<K,V> min()
          Returns but does not remove an entry with minimum key.
 Entry<K,V> removeMin()
          Removes and returns an entry with minimum key.
 int size()
          Returns the number of items in the priority queue.
 

Method Detail

size

int size()
Returns the number of items in the priority queue.


isEmpty

boolean isEmpty()
Returns whether the priority queue is empty.


min

Entry<K,V> min()
               throws EmptyPriorityQueueException
Returns but does not remove an entry with minimum key.

Throws:
EmptyPriorityQueueException

insert

Entry<K,V> insert(K key,
                  V value)
                  throws InvalidKeyException
Inserts a key-value pair and return the entry created.

Throws:
InvalidKeyException

removeMin

Entry<K,V> removeMin()
                     throws EmptyPriorityQueueException
Removes and returns an entry with minimum key.

Throws:
EmptyPriorityQueueException