SandMark version 3.0


sandmark.obfuscate.loop
Class PriorityQueue

java.lang.Object
  |
  +--sandmark.obfuscate.loop.PriorityQueue

public class PriorityQueue
extends java.lang.Object

A small modification of a LinkedList to make a priority queue. The priorities are defined by the compareTo method (in Comparable), but duplicates are allowed.

Author:
Kelly Heffner

Constructor Summary
PriorityQueue()
           
 
Method Summary
 void add(java.lang.Comparable c)
          Adds an object to the queue, behind the last object with priority less than or equal to its priority.
 java.lang.Comparable dequeue()
           
 boolean isEmpty()
           
 
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

add

public void add(java.lang.Comparable c)
Adds an object to the queue, behind the last object with priority less than or equal to its priority. (things with lower priority numbers are closer to the front of the list)

Parameters:
c - the object to add - must implement comparable

dequeue

public java.lang.Comparable dequeue()

isEmpty

public boolean isEmpty()

SandMark version 3.0

Wed Jan 29 10:30:05 MST 2003