jdsl
Class HeapSimplePriorityQueue

java.lang.Object
  |
  +--jdsl.HeapSimplePriorityQueue

public class HeapSimplePriorityQueue
extends java.lang.Object
implements SimplePriorityQueue


Constructor Summary
HeapSimplePriorityQueue(Comparator c)
           
 
Method Summary
 java.util.Iterator elements()
          Returns an iterator of the elements in this sequence
 void insertItem(java.lang.Object k, java.lang.Object e)
           
 boolean isEmpty()
           
 java.lang.Object minElement()
           
 java.lang.Object minKey()
           
 Container newContainer()
          Make a new container of this type using the same Comparator
 java.lang.Object removeMinElement()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeapSimplePriorityQueue

public HeapSimplePriorityQueue(Comparator c)
Method Detail

size

public int size()

isEmpty

public boolean isEmpty()

insertItem

public void insertItem(java.lang.Object k,
                       java.lang.Object e)
                throws InvalidKeyException
Specified by:
insertItem in interface SimplePriorityQueue

minElement

public java.lang.Object minElement()
                            throws EmptyContainerException
Specified by:
minElement in interface SimplePriorityQueue

minKey

public java.lang.Object minKey()
                        throws EmptyContainerException
Specified by:
minKey in interface SimplePriorityQueue

removeMinElement

public java.lang.Object removeMinElement()
                                  throws EmptyContainerException
Specified by:
removeMinElement in interface SimplePriorityQueue

newContainer

public Container newContainer()
Make a new container of this type using the same Comparator

elements

public java.util.Iterator elements()
Returns an iterator of the elements in this sequence