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

All Known Implementing Classes:
PriorityQueue

public interface PriorityQueueIFInt

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: 13-Oct.-2004

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

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

Method Detail

next

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

Returns:
the object with the minimum key

add

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

Parameters:
elem - the object to add

removeNext

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

Returns:
The object removed from the queue

update

void update(PriorityQueueObjectInt 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.