Class TLcdShortestRouteDistanceTable<N>
java.lang.Object
com.luciad.network.algorithm.routing.TLcdShortestRouteDistanceTable<N>
- All Implemented Interfaces:
ILcdShortestRouteDistanceTable<N>
public class TLcdShortestRouteDistanceTable<N>
extends Object
implements ILcdShortestRouteDistanceTable<N>
Default implementation of
ILcdShortestRouteDistanceTable
.- Since:
- 5.1
-
Constructor Summary
ConstructorDescriptionConstructs a new, emptyTLcdShortestRouteDistanceTable
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a node to this distance table.final double
getDistance
(N aStartNode, N aEndNode) Returns the distance of the shortest route between the two given nodes in the direction indicated by their order.getNodes()
Returns all nodes contained in this distance table.void
setDistance
(N aStartNode, N aEndNode, double aValue) Sets the distance of the shortest route between the given two nodes in the direction indicated by their order.
-
Constructor Details
-
TLcdShortestRouteDistanceTable
public TLcdShortestRouteDistanceTable()Constructs a new, emptyTLcdShortestRouteDistanceTable
.
-
-
Method Details
-
addNode
Adds a node to this distance table.- Parameters:
aNode
- the node to be added.- Throws:
IllegalArgumentException
- if the node is already part of this distance table.NullPointerException
- if the given node isnull
.
-
getNodes
Description copied from interface:ILcdShortestRouteDistanceTable
Returns all nodes contained in this distance table.- Specified by:
getNodes
in interfaceILcdShortestRouteDistanceTable<N>
- Returns:
- all nodes contained in this distance table.
-
setDistance
Sets the distance of the shortest route between the given two nodes in the direction indicated by their order.- Parameters:
aStartNode
- the first node.aEndNode
- the second node.aValue
- the value to be associated with the route in that direction.- Throws:
NullPointerException
- if one of the nodes isnull
.IllegalArgumentException
- if one of the nodes is not part of this graph.
-
getDistance
Description copied from interface:ILcdShortestRouteDistanceTable
Returns the distance of the shortest route between the two given nodes in the direction indicated by their order. If no distance was set yet,Double.POSITIVE_INFINITY
will be returned.- Specified by:
getDistance
in interfaceILcdShortestRouteDistanceTable<N>
- Parameters:
aStartNode
- the first node.aEndNode
- the second node.- Returns:
- the value to be associated with the edge in that direction.
-