Class BasicDirectedEdge

    • Constructor Detail

      • BasicDirectedEdge

        public BasicDirectedEdge​(DirectedNode in,
                                 DirectedNode out)
        Contstructs a new DirectedEdge.
        Parameters:
        in - The in node of the edge.
        out - The out node of the edge.
    • Method Detail

      • getOtherNode

        public Node getOtherNode​(Node node)
        Description copied from interface: Edge
        Returns one of the two nodes of an edge. If the specified node is node A, then node B is returned, and vice versa.
        Specified by:
        getOtherNode in interface Edge
        Parameters:
        node - The node opposite of the node to return.
        Returns:
        Node A if node B is specified, node B if node A is specified.
        See Also:
        Edge.getOtherNode(Node)
      • reverse

        public void reverse()
        Removes the edge from the out list of the in node and from the in list of the out node. Nodes are switched and then the edge is added to the in list of the new out node, and to the out list of the new in node.
        Specified by:
        reverse in interface Edge
        See Also:
        Edge.reverse()
      • getRelated

        public Iterator<Edge> getRelated()
        Returns an iterator over all edges incident to both the in and out nodes.
        Specified by:
        getRelated in interface Graphable
        Returns:
        Iterator An iterator over other components of the graph that are related to the component.
        See Also:
        Graphable.getRelated()
      • compareNodes

        public int compareNodes​(Edge other)
        Description copied from interface: Edge
        Compares the node orientation of the edge with another edge.
        Specified by:
        compareNodes in interface Edge
        Returns:
        EQUAL_NODE_ORIENTATION : both nodes are equal in the correct order. UNEQUAL_NODE_ORIENTATION: both nodes are not equal OPPOSITE_NODE_ORIENTATION : both nodes are equal in opposite order.
        See Also:
        Edge.compareNodes(Edge)