cc.mallet.util.search
Interface PriorityQueue
-
- All Known Implementing Classes:
- MinHeap
public interface PriorityQueueCreated by IntelliJ IDEA. User: pereira Date: Jun 18, 2005 Time: 7:46:46 PM Interface representing the basic methods for a priority queue.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidchangePriority(QueueElement e, double priority)Change the priority of queue elementetopriority.booleancontains(QueueElement e)Does the queue contain an element?QueueElementextractMin()Remove the top element of the queue.voidinsert(QueueElement e)Insert elementeinto the queue.QueueElementmin()Return the top element of the queue.intsize()The current size of the queue.QueueElement[]toArray()Returns any array containing all of the elements in the queue.
-
-
-
Method Detail
-
insert
void insert(QueueElement e)
Insert elementeinto the queue.- Parameters:
e- the element to insert
-
size
int size()
The current size of the queue.- Returns:
- current size
-
min
QueueElement min()
Return the top element of the queue.- Returns:
- top element of the queue
-
extractMin
QueueElement extractMin()
Remove the top element of the queue.- Returns:
- the element removed
-
changePriority
void changePriority(QueueElement e, double priority)
Change the priority of queue elementetopriority. The element's position in the queue is adjusted as needed.- Parameters:
e- the element that has been changedpriority- the new priority
-
contains
boolean contains(QueueElement e)
Does the queue contain an element?- Parameters:
e- the element- Returns:
- whether the queue contains the element
-
toArray
QueueElement[] toArray()
Returns any array containing all of the elements in the queue. They are not guaranteed to be in any particular order.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG