at.jku.ssw
Class PriorityQueue

java.lang.Object
  extended by at.jku.ssw.PriorityQueue

public abstract class PriorityQueue
extends java.lang.Object

An unbounded priority queue based on a priority heap.


Constructor Summary
PriorityQueue()
           
 
Method Summary
abstract  void clear()
          Removes all elements from the priority queue.
abstract  Iterator iterator()
          Returns an iterator of the values in this priority queue.
abstract  void offer(char value)
          Inserts the value into this priority queue.
abstract  char peek()
          Retrieves, but does not remove, the head of this queue.
abstract  char poll()
          Retrieves and removes the head of this priority queue.
abstract  boolean remove(char value)
          Removes a single instance of the specified character from this queue, if it is present.
abstract  int size()
          Returns the number of values in this priority queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PriorityQueue

public PriorityQueue()
Method Detail

offer

public abstract void offer(char value)
Inserts the value into this priority queue.


poll

public abstract char poll()
Retrieves and removes the head of this priority queue. NoSuchElementException if this priority queue is empty.


size

public abstract int size()
Returns the number of values in this priority queue.


iterator

public abstract Iterator iterator()
Returns an iterator of the values in this priority queue.


clear

public abstract void clear()
Removes all elements from the priority queue.


peek

public abstract char peek()
Retrieves, but does not remove, the head of this queue. NoSuchElementException if this priority queue is empty.


remove

public abstract boolean remove(char value)
Removes a single instance of the specified character from this queue, if it is present. Returns true if the value is present in the priority queue, otherwise false.