Interface DirectedNode

All Superinterfaces:
DirectedGraphable, Graphable, Node
All Known Implementing Classes:
BasicDirectedNode, BasicDirectedXYNode, OptDirectedNode, OptDirectedXYNode

public interface DirectedNode extends Node, DirectedGraphable
Represents a node in a directed graph. A directed node differentiates between adjacent edges that start at the node and those adjacent edges that terminate at the node. The former are referred to as "in" edges, and the latter "out" edges.
Author:
Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
See Also:
  • Method Details

    • addIn

      void addIn(DirectedEdge e)
      Adds an edge to the in adjacency list of the node.
      Parameters:
      e - A directed edge that terminates at the node.
      See Also:
    • addOut

      void addOut(DirectedEdge e)
      Adds an edge to the out adjacency list of the node.
      Parameters:
      e - A directed edge that originates from the node.
      See Also:
    • removeIn

      void removeIn(DirectedEdge e)
      Removes an edge from the in adjacency list of the node.
      Parameters:
      e - A directed edge that terminates at the node.
      See Also:
    • removeOut

      void removeOut(DirectedEdge e)
      Removes an edge from the out adjacency list of node.
      Parameters:
      e - A directed edge that originates from the node.
      See Also:
    • getInEdge

      Edge getInEdge(DirectedNode other)
      Returns an edge that terminates at the node and originates from a specified node.

      Note: It is possible for two nodes to share multiple edges between them. In this case, getInEdges(Node other) can be used to obtain a complete list.
      Parameters:
      other - The originating node.
      Returns:
      The first edge found to terminate at the node and originate from the specefied node.
      See Also:
    • getInEdges

      List<? extends Edge> getInEdges(DirectedNode other)
      Returns all edges that terminate at the node and originate from a specified node.
      Parameters:
      other - The originating node.
      Returns:
      All edges found to terminate at the node and originate from the specified node.
      See Also:
    • getInEdges

      List<? extends Edge> getInEdges()
      Returns the in adjacency list of the node.
      Returns:
      A list of edges that terminate at the node.
      See Also:
    • getOutEdge

      Edge getOutEdge(DirectedNode other)
      Returns an edge that originates at the node and terminates at a specified node.

      Note: It is possible for two nodes to share multiple edges between them. In this case, getOutEdges(Node other) can be used to obtain a complete list.
      Parameters:
      other - The terminating node.
      Returns:
      The first edge found to originate at the node and terminate at the specefied node.
      See Also:
    • getOutEdges

      List<? extends Edge> getOutEdges(DirectedNode other)
      Returns all edges that originate at the node and terminate from at specified node.
      Parameters:
      other - The temimnating node.
      Returns:
      All edges found to originate at the node and terminate at the specified node.
      See Also:
    • getOutEdges

      List<? extends Edge> getOutEdges()
      Returns the out adjacency list of the node.
      Returns:
      A list of edges originating at the node.
      See Also:
    • getInDegree

      int getInDegree()
      Returns the in degree of the node.
      Returns:
      The number of edges that terminate at the node.
    • getOutDegree

      int getOutDegree()
      Returns the out degree of the node.
      Returns:
      The number of edges that originate at the node.