edu.unima.ky.parallel
Class PriorityQueue

java.lang.Object
  |
  +--edu.unima.ky.parallel.PriorityQueue

public class PriorityQueue
extends java.lang.Object

Priority Queue This is a thread unsafe version.


Constructor Summary
PriorityQueue()
          Constructs a priority queue
PriorityQueue(int initcap)
          Constructs a priority queue
PriorityQueue(int initcap, int capinc)
          Constructs a priority queue
 
Method Summary
 int capacity()
          Returns the capacity of the queue.
 edu.unima.ky.parallel.Rank get()
          Returns the first object and advance the pointer.
 void insert(edu.unima.ky.parallel.Rank obj)
          Inserts an object.
 edu.unima.ky.parallel.Rank peek()
          Returns the first object.
 int size()
          Returns the size of the queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PriorityQueue

public PriorityQueue(int initcap,
                     int capinc)
Constructs a priority queue

Parameters:
initcap - the initial capacity
capinc - the capcity increment

PriorityQueue

public PriorityQueue(int initcap)
Constructs a priority queue

Parameters:
initcap - the inicial capacity

PriorityQueue

public PriorityQueue()
Constructs a priority queue

Method Detail

size

public int size()
Returns the size of the queue.


capacity

public int capacity()
Returns the capacity of the queue.


insert

public void insert(edu.unima.ky.parallel.Rank obj)
Inserts an object. The queue will grow automatically as it fills up.


get

public edu.unima.ky.parallel.Rank get()
                               throws java.lang.RuntimeException
Returns the first object and advance the pointer.

java.lang.RuntimeException

peek

public edu.unima.ky.parallel.Rank peek()
                                throws java.lang.RuntimeException
Returns the first object.

java.lang.RuntimeException