Interface ILcdRoute<N,E>

All Known Implementing Classes:
TLcdRoute

public interface ILcdRoute<N,E>
An ILcdRoute describes a route in a graph, i.e. a sequence of connected edges in a graph. With 'connected edges' is meant that the following invariant should always apply for each ILcdRoute:

every edge in a route should have at least one node in common with its immediate predecessor edge, and at least one node in common with its immediate successor edge.

No further constraints are imposed on the route: nodes or edges can be passed multiple times, closed circuits are allowed, etc ...

Note: with 'positive direction', we mean the direction following the route from the first edge of the route to the last edge of the route.

Since:
5.1
  • Method Summary

    Modifier and Type
    Method
    Description
    getEdge(int aIndex)
    Returns the edge at position aIndex in this route, counting in positive direction and starting from 0 for the first edge.
    int
    Returns the number of edges in this route.
    Returns the end node of this route, this is the node of the last edge of the route that is passed last when following the route in positive direction.
    getNode(int aIndex)
    Returns the node at position aIndex in this route, counting in positive direction and starting from 0 for the start node.
    int
    Returns the number of nodes in this route, this should always equal the number of edges in this route + 1.
    Returns the start node of this route, this is the node of the first edge of the route that is passed first when following the route in positive direction.
  • Method Details

    • getEdgeCount

      int getEdgeCount()
      Returns the number of edges in this route. Edges which are passed multiple times, are counted as many times as they are passed.
      Returns:
      the number of edges in this route.
    • getEdge

      E getEdge(int aIndex)
      Returns the edge at position aIndex in this route, counting in positive direction and starting from 0 for the first edge.
      Parameters:
      aIndex - the index of the edge in the route.
      Returns:
      the edge with the given index in this route.
      Throws:
      IndexOutOfBoundsException - aIndex < 0 || aIndex >= getEdgeCount().
    • getNodeCount

      int getNodeCount()
      Returns the number of nodes in this route, this should always equal the number of edges in this route + 1. Nodes which are passed multiple times, are counted as many times as they are passed. Start node and end node are included in the route.
      Returns:
      the number of nodes in this route.
    • getNode

      N getNode(int aIndex)
      Returns the node at position aIndex in this route, counting in positive direction and starting from 0 for the start node.
      Parameters:
      aIndex - the index of the node in the route.
      Returns:
      the node with the given index in this route.
      Throws:
      IndexOutOfBoundsException - aIndex < 0 || aIndex >= getNodeCount().
    • getStartNode

      N getStartNode()
      Returns the start node of this route, this is the node of the first edge of the route that is passed first when following the route in positive direction. This is not necessarily the same as route.getEdge(0).getStartNode(): an edge can have its orientation in opposite direction of the positive route direction, in which case the start node of the route will be equal to route.getEdge(0).getEndNode().
      Returns:
      the start Object of this route.
    • getEndNode

      N getEndNode()
      Returns the end node of this route, this is the node of the last edge of the route that is passed last when following the route in positive direction. This is not necessarily the same as route.getEdge(route.getEdgeCount-1).getEndNode(): an edge can have its orientation in opposite direction of the route direction, in which case the end node of the route will be equal to route.getEdge(route.getEdgeCount-1).getStartNode().
      Returns:
      the end Object of this route.