org.javanetworkanalyzer.data
Class VDijkstra<V extends VDijkstra,E>

java.lang.Object
  extended by org.javanetworkanalyzer.data.VId
      extended by org.javanetworkanalyzer.data.VPredImpl<V,E>
          extended by org.javanetworkanalyzer.data.VDijkstra<V,E>
Type Parameters:
V - Vertex
All Implemented Interfaces:
VDist<Double>, VPred<V,E>
Direct Known Subclasses:
VAccess, VWCent

public class VDijkstra<V extends VDijkstra,E>
extends VPredImpl<V,E>
implements VDist<Double>

Vertex to be used in the Dijkstra algorithm.

Author:
Adam Gouge

Field Summary
static Double DEFAULT_DISTANCE
          The default distance assigned to all nodes at the beginning of the Dijkstra algorithm.
 
Constructor Summary
VDijkstra(Integer id)
          Constructor: Sets the id.
 
Method Summary
 Double getDistance()
          Returns the length of the shortest path from a source node to this node.
 void reset()
          Clears the predecessor list and resets the distance to the default distance.
 void setDistance(Double newDistance)
          Sets the new length of a shortest path from a source node to this node.
 void setSource()
          Clears the predecessor list and sets the distance to zero.
 
Methods inherited from class org.javanetworkanalyzer.data.VPredImpl
addPredecessor, addPredecessorEdge, clear, getPredecessorEdges, getPredecessors
 
Methods inherited from class org.javanetworkanalyzer.data.VId
getID, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_DISTANCE

public static final Double DEFAULT_DISTANCE
The default distance assigned to all nodes at the beginning of the Dijkstra algorithm.

Constructor Detail

VDijkstra

public VDijkstra(Integer id)
Constructor: Sets the id.

Parameters:
id - Id
Method Detail

getDistance

public Double getDistance()
Description copied from interface: VDist
Returns the length of the shortest path from a source node to this node.

Specified by:
getDistance in interface VDist<Double>
Returns:
The length of the shortest path from a source node to this node.

setDistance

public void setDistance(Double newDistance)
Description copied from interface: VDist
Sets the new length of a shortest path from a source node to this node.

Specified by:
setDistance in interface VDist<Double>
Parameters:
newDistance - Length of a shortest path to this node.

reset

public void reset()
Clears the predecessor list and resets the distance to the default distance.

Specified by:
reset in interface VDist<Double>

setSource

public void setSource()
Clears the predecessor list and sets the distance to zero.

Specified by:
setSource in interface VDist<Double>


Copyright © 2014. All Rights Reserved.