public class TLcdShortestRouteDistanceTable<N> extends Object implements ILcdShortestRouteDistanceTable<N>
ILcdShortestRouteDistanceTable
.Constructor and Description |
---|
TLcdShortestRouteDistanceTable()
Constructs a new, empty
TLcdShortestRouteDistanceTable . |
Modifier and Type | Method and Description |
---|---|
void |
addNode(N aNode)
Adds a node to this distance table.
|
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.
|
Enumeration<N> |
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.
|
public TLcdShortestRouteDistanceTable()
TLcdShortestRouteDistanceTable
.public void addNode(N aNode)
aNode
- the node to be added.IllegalArgumentException
- if the node is already part of this
distance table.NullPointerException
- if the given node is null
.public Enumeration<N> getNodes()
ILcdShortestRouteDistanceTable
getNodes
in interface ILcdShortestRouteDistanceTable<N>
public void setDistance(N aStartNode, N aEndNode, double aValue)
aStartNode
- the first node.aEndNode
- the second node.aValue
- the value to be associated with the route in that
direction.NullPointerException
- if one of the nodes is null
.IllegalArgumentException
- if one of the nodes is not part of this graph.public final double getDistance(N aStartNode, N aEndNode)
ILcdShortestRouteDistanceTable
Double.POSITIVE_INFINITY
will be returned.getDistance
in interface ILcdShortestRouteDistanceTable<N>
aStartNode
- the first node.aEndNode
- the second node.