fr.inria.opengve.tools.dataStructures.interfaces
Interface PriorityQueue<E,V extends java.lang.Comparable<V>>

Type Parameters:
E - The type of element in the priority queue.
V - The type of values associated with each element.
All Known Implementing Classes:
BinaryTree, FibonacciHeap

public interface PriorityQueue<E,V extends java.lang.Comparable<V>>

Interface defining priority queue data structure. In this type of structures each element is associated with a value, method like findMin() can be used to get the element with the lesser value.

Author:
fabrice.peix@sophia.inria.fr

Method Summary
 void clear()
          Make the priority queue logically empty.
 boolean contains(E x)
          Say if the priority queue contains a given elemeent.
 E deleteMin()
          Remove the smallest item from the priority queue.
 E findMin()
          Find the smallest item in the priority queue.
 V getValueOf(E element)
          Give the value of a given element.
 void insert(E x, V value)
          Insert into the priority queue.
 boolean isEmpty()
          Test if the priority queue is logically empty.
 

Method Detail

insert

void insert(E x,
            V value)
Insert into the priority queue. Duplicate are allowed.

Parameters:
x - The object to insert.
value - The value of the object.

findMin

E findMin()
          throws java.util.NoSuchElementException
Find the smallest item in the priority queue.

Returns:
the smallest item.
Throws:
java.util.NoSuchElementException - if the priority queue is empty.

getValueOf

V getValueOf(E element)
                                             throws java.util.NoSuchElementException
Give the value of a given element.

Parameters:
element - The element.
Returns:
The value of element.
Throws:
java.util.NoSuchElementException - If the priority queue doesn't contains this element.

deleteMin

E deleteMin()
            throws java.util.NoSuchElementException
Remove the smallest item from the priority queue.

Returns:
the smallest item.
Throws:
java.util.NoSuchElementException - if the priority queue is empty.

clear

void clear()
Make the priority queue logically empty.


isEmpty

boolean isEmpty()
Test if the priority queue is logically empty.

Returns:
true if empty, false otherwise.

contains

boolean contains(E x)
Say if the priority queue contains a given elemeent.

Parameters:
x - The element.
Returns:
true if the element belong to the priority queue and false otherwise.


Copyright © 2009 INRIA (Projet Mascotte). All Rights Reserved.