org.neo4j.graphalgo.impl.shortestpath
Class DijkstraPriorityQueueImpl<CostType>

java.lang.Object
  extended by org.neo4j.graphalgo.impl.shortestpath.DijkstraPriorityQueueImpl<CostType>
Type Parameters:
CostType - The datatype the path weigths are represented by.
All Implemented Interfaces:
DijkstraPriorityQueue<CostType>

public class DijkstraPriorityQueueImpl<CostType>
extends Object
implements DijkstraPriorityQueue<CostType>

Implementation of DijkstraPriorityQueue with just a normal java priority queue.


Nested Class Summary
protected  class DijkstraPriorityQueueImpl.pathObject
          Data structure used for the internal priority queue
 
Constructor Summary
DijkstraPriorityQueueImpl(Comparator<CostType> costComparator)
           
 
Method Summary
 void decreaseValue(Node node, CostType newValue)
          Used to update a value in the queue (or insert it).
 Node extractMin()
          Retrieve and remove
 void insertValue(Node node, CostType value)
          Used to insert a new value into the queue.
 boolean isEmpty()
           
 Node peek()
          Retrieve without removing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DijkstraPriorityQueueImpl

public DijkstraPriorityQueueImpl(Comparator<CostType> costComparator)
Method Detail

insertValue

public void insertValue(Node node,
                        CostType value)
Description copied from interface: DijkstraPriorityQueue
Used to insert a new value into the queue.

Specified by:
insertValue in interface DijkstraPriorityQueue<CostType>

decreaseValue

public void decreaseValue(Node node,
                          CostType newValue)
Description copied from interface: DijkstraPriorityQueue
Used to update a value in the queue (or insert it).

Specified by:
decreaseValue in interface DijkstraPriorityQueue<CostType>

extractMin

public Node extractMin()
Retrieve and remove

Specified by:
extractMin in interface DijkstraPriorityQueue<CostType>

peek

public Node peek()
Retrieve without removing

Specified by:
peek in interface DijkstraPriorityQueue<CostType>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface DijkstraPriorityQueue<CostType>
Returns:
True if the queue is empty.


Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.