Search this API

y.util.pq
Interface NodePQ

All Known Implementing Classes:
BHeapNodePQ

public interface NodePQ

Defines an interface for specialized priority queues that contains nodes which are prioritized by a comparable values.

 
Your browser does not support SVG content.

Method Summary
 void add(Node v, java.lang.Object priority)
          Adds the given node with the given priority to the queue.
 void clear()
          Makes this queue the empty queue.
 boolean contains(Node v)
          Returns whether or not the given node is contained in this queue.
 void decreasePriority(Node v, java.lang.Object priority)
          Decreased the priority value of the given node.
 Node getMin()
          Returns he node with smallest priority in this queue.
 java.lang.Object getPriority(Node v)
          Returns the current priority of the given node.
 boolean isEmpty()
          Returns whether or not this queue is empty
 Node removeMin()
          Removes the node with smallest priority from this queue.
 int size()
          Returns the number of nodes currently in this queue
 

Method Detail

add

void add(Node v,
         java.lang.Object priority)
Adds the given node with the given priority to the queue.

Precondition:
!contains(v)

decreasePriority

void decreasePriority(Node v,
                      java.lang.Object priority)
Decreased the priority value of the given node.

Preconditions:
contains(v)
c.compare(p,getPriority(v)) < 0, where c is the corresponding comparator for the priorities in this queue.

removeMin

Node removeMin()
Removes the node with smallest priority from this queue.

Precondition:
!isEmpty()
Returns:
the removed node with smallest priority

getMin

Node getMin()
Returns he node with smallest priority in this queue.

Precondition:
!isEmpty()

clear

void clear()
Makes this queue the empty queue. in this queue.


contains

boolean contains(Node v)
Returns whether or not the given node is contained in this queue.


getPriority

java.lang.Object getPriority(Node v)
Returns the current priority of the given node.


isEmpty

boolean isEmpty()
Returns whether or not this queue is empty


size

int size()
Returns the number of nodes currently in this queue


© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.