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

    Constructors
    Constructor
    Description
    Constructs a new, empty TLcdShortestRouteDistanceTable.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addNode(N aNode)
    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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TLcdShortestRouteDistanceTable

      public TLcdShortestRouteDistanceTable()
      Constructs a new, empty TLcdShortestRouteDistanceTable.
  • Method Details

    • addNode

      public void addNode(N aNode)
      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 is null.
    • getNodes

      public Enumeration<N> getNodes()
      Description copied from interface: ILcdShortestRouteDistanceTable
      Returns all nodes contained in this distance table.
      Specified by:
      getNodes in interface ILcdShortestRouteDistanceTable<N>
      Returns:
      all nodes contained in this distance table.
    • setDistance

      public 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.
      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 is null.
      IllegalArgumentException - if one of the nodes is not part of this graph.
    • getDistance

      public final double getDistance(N aStartNode, N aEndNode)
      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 interface ILcdShortestRouteDistanceTable<N>
      Parameters:
      aStartNode - the first node.
      aEndNode - the second node.
      Returns:
      the value to be associated with the edge in that direction.