be.ac.ulg.montefiore.run.totem.util
Interface PriorityQueueIF

All Known Implementing Classes:
CSPFPriorityQueue

public interface PriorityQueueIF

Interface that describes the operations on a priority queue. A priority queue is a structure that allows access to the element with the lowest key in a O(1) time and the add or delete operation in O(log(N)).

Creation date: 05-Jan.-2004

Author:
Fabian Skivee (skivee@run.montefiore.ulg.ac.be)

Method Summary
 void add(PriorityQueueObject elem)
          Adds an object to the queue.
 PriorityQueueObject next()
          Gets the object with the minimum key in the queue
 PriorityQueueObject removeNext()
          Removes and returns the next object from the queue
 int size()
          Gets the size of the queue
 void update(PriorityQueueObject elem)
          Updates the Object with the same id in the queue
 

Method Detail

next

PriorityQueueObject next()
Gets the object with the minimum key in the queue

Returns:
the object with the minimum key

add

void add(PriorityQueueObject elem)
Adds an object to the queue.

Parameters:
elem - the object to add

removeNext

PriorityQueueObject removeNext()
Removes and returns the next object from the queue

Returns:
The object removed from the queue

update

void update(PriorityQueueObject elem)
Updates the Object with the same id in the queue

Parameters:
elem - The object to update in the queue

size

int size()
Gets the size of the queue

Returns:
size of the queue


Copyright © 2004-2007 Research Unit in Networking, All Rights Reserved.