Class UpdateQueue
java.lang.Object
weka.clusterers.forOPTICSAndDBScan.Utils.UpdateQueue
- All Implemented Interfaces:
RevisionHandler
UpdateQueue.java
Authors: Rainer Holzmann, Zhanna Melnikova-Albrecht, Matthias Schubert
Date: Aug 27, 2004
Time: 5:36:35 PM
$ Revision 1.4 $
- Version:
- $Revision: 1.3 $
- Author:
- Matthias Schubert (schubert@dbs.ifi.lmu.de), Zhanna Melnikova-Albrecht (melnikov@cip.ifi.lmu.de), Rainer Holzmann (holzmann@cip.ifi.lmu.de)
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new PriorityQueue (backed on a binary heap) with the ability to efficiently update the priority of the stored objects in the heap. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new Object to the queuedouble
getPriority
(int index) Returns the priority for the object at the specified indexReturns the revision string.boolean
hasNext()
Tests, if the queue has some more elements leftnext()
Returns the element with the lowest priorityint
size()
Returns the queue's size
-
Constructor Details
-
UpdateQueue
public 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. The ascending (!) queue is dynamically growing and shrinking.
-
-
Method Details
-
add
Adds a new Object to the queue- Parameters:
priority
- The priority associated with the object (in this case: the reachability-distance)o
-objectKey
- The key for this object
-
getPriority
public double getPriority(int index) Returns the priority for the object at the specified index- Parameters:
index
- the index of the object- Returns:
- priority
-
size
public int size()Returns the queue's size- Returns:
- size
-
hasNext
public boolean hasNext()Tests, if the queue has some more elements left- Returns:
- true, if there are any elements left, else false
-
next
Returns the element with the lowest priority- Returns:
- next element
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-