de.cau.cs.kieler.sj.util
Class PriorityQueue<T extends Comparable<T>>

java.lang.Object
  extended by de.cau.cs.kieler.sj.util.AbstractCollection<T>
      extended by de.cau.cs.kieler.sj.util.PriorityQueue<T>
Type Parameters:
T - The type of the element inserts into the list.
All Implemented Interfaces:
Iterable<T>

public class PriorityQueue<T extends Comparable<T>>
extends AbstractCollection<T>

A simple PriorityQueue how we need them for SJ.

Rating red

Field Summary
 
Fields inherited from class de.cau.cs.kieler.sj.util.AbstractCollection
cursor, lastContainer, leftSentinel, size
 
Constructor Summary
PriorityQueue()
          Creates a new empty PriorityQueue.
 
Method Summary
 void add(T o)
          Adds a given element to the collection.
 T peek()
          Return the first value of the queue.
 T poll()
          Return and delete the first value of the queue.
 
Methods inherited from class de.cau.cs.kieler.sj.util.AbstractCollection
clear, contains, isEmpty, iterator, remove, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PriorityQueue

public PriorityQueue()
Creates a new empty PriorityQueue.

Method Detail

peek

public T peek()
Return the first value of the queue.

Returns:
The first value of the queue.
See Also:
poll()

poll

public T poll()
Return and delete the first value of the queue.

Returns:
The first value of the queue.
See Also:
peek()

add

public void add(T o)
Description copied from class: AbstractCollection
Adds a given element to the collection.

Specified by:
add in class AbstractCollection<T extends Comparable<T>>
Parameters:
o - The element to add.