public class UpdateQueue extends Object implements RevisionHandler
UpdateQueue.java
Authors: Rainer Holzmann, Zhanna Melnikova-Albrecht, Matthias Schubert
Date: Aug 27, 2004
Time: 5:36:35 PM
$ Revision 1.4 $
Constructor and Description |
---|
UpdateQueue()
Creates a new PriorityQueue (backed on a binary heap) with the ability to efficiently
update the priority of the stored objects in the heap.
|
Modifier and Type | Method and Description |
---|---|
void |
add(double priority,
Object o,
String objectKey)
Adds a new Object to the queue
|
double |
getPriority(int index)
Returns the priority for the object at the specified index
|
String |
getRevision()
Returns the revision string.
|
boolean |
hasNext()
Tests, if the queue has some more elements left
|
UpdateQueueElement |
next()
Returns the element with the lowest priority
|
int |
size()
Returns the queue's size
|
public UpdateQueue()
public void add(double priority, Object o, String objectKey)
priority
- The priority associated with the object (in this case: the reachability-distance)objectKey
- The key for this objecto
- public double getPriority(int index)
index
- the index of the objectpublic int size()
public boolean hasNext()
public UpdateQueueElement next()
public String getRevision()
getRevision
in interface RevisionHandler
Copyright © 2019 University of Waikato, Hamilton, NZ. All rights reserved.