|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.util.pq.DoubleObjectPQ
public class DoubleObjectPQ
This class implements a priority queue for objects whose priority values are of type double.
The implementation is based on binary heaps.
Constructor Summary | |
---|---|
DoubleObjectPQ(int initialSize,
DataProvider provider,
DataAcceptor acceptor)
Creates an empty ObjectPQ using the given DataProvider and
DataAcceptor to store and retrieve Object support information. |
Method Summary | |
---|---|
void |
add(java.lang.Object o,
double priority)
Adds the given object with given priority to this queue. |
void |
changePriority(java.lang.Object o,
double priority)
Changes the priority value of the given object. |
void |
clear()
Makes this queue the empty queue. |
boolean |
contains(java.lang.Object o)
Returns whether or not the given object is contained. |
void |
decreasePriority(java.lang.Object o,
double priority)
Decreases the priority value of the given object. |
void |
dispose()
Does nothing. |
java.lang.Object |
getMin()
Returns the object with smallest priority in this queue. |
double |
getMinPriority()
Returns the minimum priority value in this queue. |
double |
getPriority(java.lang.Object o)
Returns the current priority of the given object. |
void |
increasePriority(java.lang.Object o,
double priority)
Increases the priority value of the given object. |
boolean |
isEmpty()
Returns whether or not this queue is empty. |
void |
remove(java.lang.Object o)
Removes the given object from this queue. |
java.lang.Object |
removeMin()
Removes the object with smallest priority from this queue. |
int |
size()
Returns the number of nodes currently in this queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DoubleObjectPQ(int initialSize, DataProvider provider, DataAcceptor acceptor)
DataProvider
and
DataAcceptor
to store and retrieve Object support information.
The contents of the provider should be modified through the use of the
acceptor, i.e. they should be based on the same initially empty backing store.
Additionally this backing store should not be modified externally as long as
this PQ is still in use.
Method Detail |
---|
public void add(java.lang.Object o, double priority)
public void decreasePriority(java.lang.Object o, double priority)
public void increasePriority(java.lang.Object o, double priority)
public void changePriority(java.lang.Object o, double priority)
public java.lang.Object removeMin()
public java.lang.Object getMin()
public double getMinPriority()
public boolean contains(java.lang.Object o)
public boolean isEmpty()
public int size()
public double getPriority(java.lang.Object o)
public void remove(java.lang.Object o)
public void clear()
public void dispose()
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |