inf.util
Interface IntPriorityQueue<E>

Type Parameters:
E - the element type for elements queued
All Superinterfaces:
java.lang.Iterable<E>, PriorityQueue<E,java.lang.Integer>
All Known Implementing Classes:
ArrayOfHashedListsIntPriorityQueue, ArrayOfListsIntPriorityQueue, RandomAccessIntPriorityQueue

public interface IntPriorityQueue<E>
extends PriorityQueue<E,java.lang.Integer>

This class represents a priority queue, that is a queue in which elements can be held and from which they can be retrieved by priority. For this purpose, each element has a priority associated with it that determines when in relation to the other elements in the queue this element should be retrieved. Priorities are ints here.

Author:
Gerhard Wickler

Method Summary
 void addElementFirst(E elt, int priority)
           This function adds the given element at the given priority to this priority queue.
 void addElementLast(E elt, int priority)
           This function adds the given element at the given priority to this priority queue.
 boolean containsElementAt(E elt, int priority)
           This function tests whether the given element is currently in this queue at the given priority.
 boolean removeElementAt(E elt, int priority)
           This function attempts to remove the given element at the given priority from this priority queue.
 
Methods inherited from interface inf.util.PriorityQueue
addElementFirst, addElementLast, containsElementAt, getHighestFirst, getHighestLast, getLowestFirst, getLowestLast, isEmpty, length, removeElementAt, removeHighestFirst, removeHighestLast, removeLowestFirst, removeLowestLast
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

addElementFirst

void addElementFirst(E elt,
                     int priority)

This function adds the given element at the given priority to this priority queue. If there are already elements queued at this priority, the new element will be queued at the front.

Parameters:
elt - the element to be added to this IntPriorityQueue
priority - the priority with which the element is to be queued

addElementLast

void addElementLast(E elt,
                    int priority)

This function adds the given element at the given priority to this priority queue. If there are already elements queued at this priority, the new element will be queued at the end.

Parameters:
elt - the element to be added to this IntPriorityQueue
priority - the priority with which the element is to be queued

containsElementAt

boolean containsElementAt(E elt,
                          int priority)

This function tests whether the given element is currently in this queue at the given priority.

Parameters:
elt - the element to be tested for
priority - the priority at which it should be queued
Returns:
whether it is indeed in the queue

removeElementAt

boolean removeElementAt(E elt,
                        int priority)

This function attempts to remove the given element at the given priority from this priority queue. Whether the removal was successful is returned.

Parameters:
elt - the element to be removed from this IntPriorityQueue
priority - the priority at which the element is currently queued
Returns:
true if and only if the element was indeed removed from the queue