|
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.IntObjectPQ
public class IntObjectPQ
This class implements a priority queue for objects whose priority values are of type int.
The implementation is based on binary heaps.
Constructor Summary | |
---|---|
IntObjectPQ(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,
int priority)
Adds the given node with with given priority to this queue. |
void |
changePriority(java.lang.Object o,
int p)
Changes the priority value of the given node. |
void |
clear()
Makes this queue the empty queue. |
boolean |
contains(java.lang.Object o)
Returns whether or not the given node is contained in this queue. |
void |
decreasePriority(java.lang.Object o,
int priority)
Decreases the priority value of the given node. |
void |
dispose()
Does nothing. |
java.lang.Object |
getMin()
Returns he node with smallest priority in this queue. |
int |
getMinPriority()
Returns the minimum priority value in this queue. |
int |
getPriority(java.lang.Object o)
Returns the current priority of the given node. |
void |
increasePriority(java.lang.Object o,
int priority)
Increases the priority value of the given node. |
boolean |
isEmpty()
Returns whether or not this queue is empty |
void |
remove(java.lang.Object o)
Removes the given node from this queue. |
java.lang.Object |
removeMin()
Removes the node 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 IntObjectPQ(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, int priority)
public void decreasePriority(java.lang.Object o, int priority)
public void increasePriority(java.lang.Object o, int priority)
public void changePriority(java.lang.Object o, int p)
public java.lang.Object removeMin()
public java.lang.Object getMin()
public int getMinPriority()
public boolean contains(java.lang.Object o)
public boolean isEmpty()
public int size()
public int 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 |