datastructures

net.datastructures
Interface PriorityQueue

All Known Subinterfaces:
AdaptablePriorityQueue
All Known Implementing Classes:
HeapAdaptablePriorityQueue, HeapPriorityQueue, SortedListAdaptablePriorityQueue, SortedListPriorityQueue

public interface PriorityQueue

Interface for the priority queue ADT


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

Method Detail

size

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


isEmpty

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


min

public Entry min()
          throws EmptyPriorityQueueException
Returns but does not remove an entry with minimum key.

Throws:
EmptyPriorityQueueException

insert

public Entry insert(Object key,
                    Object value)
             throws InvalidKeyException
Inserts a key-value pair and return the entry created.

Throws:
InvalidKeyException

removeMin

public Entry removeMin()
                throws EmptyPriorityQueueException
Removes and returns an entry with minimum key.

Throws:
EmptyPriorityQueueException

datastructures