org.javanetworkanalyzer.data
Interface VDist<D extends Number>

Type Parameters:
D - Distance type (usually Integer or Double)
All Known Implementing Classes:
VAccess, VBFS, VDijkstra, VUCent, VWCent

public interface VDist<D extends Number>

Interface for vertices that measure the distance from a source node.

Author:
Adam Gouge

Method Summary
 D getDistance()
          Returns the length of the shortest path from a source node to this node.
 void reset()
          Resets this node's distance to the default distance value.
 void setDistance(D newDistance)
          Sets the new length of a shortest path from a source node to this node.
 void setSource()
          Sets this node's distance to zero.
 

Method Detail

getDistance

D getDistance()
Returns the length of the shortest path from a source node to this node.

Returns:
The length of the shortest path from a source node to this node.

setDistance

void setDistance(D newDistance)
Sets the new length of a shortest path from a source node to this node.

Parameters:
newDistance - Length of a shortest path to this node.

reset

void reset()
Resets this node's distance to the default distance value.


setSource

void setSource()
Sets this node's distance to zero.



Copyright © 2014. All Rights Reserved.