Interface EdgeSegment

    • Method Detail

      • remove

        boolean remove​(DirectedVertex vertex)
        Remove the vertex from the edge segment if it is either the up or downstream vertex
        Parameters:
        vertex - to remove
        Returns:
        true when successful, false otherwise
      • setUpstreamVertex

        void setUpstreamVertex​(DirectedVertex vertexToReplaceWith)
        Set another upstream vertex.
        Parameters:
        vertexToReplaceWith - to use
      • getUpstreamVertex

        DirectedVertex getUpstreamVertex()
        Get the segment's upstream vertex
        Returns:
        upstream vertex
      • getDownstreamVertex

        DirectedVertex getDownstreamVertex()
        Get the segment's downstream vertex
        Returns:
        downstream vertex
      • setDownstreamVertex

        void setDownstreamVertex​(DirectedVertex vertexToReplaceWith)
        Set another downstream vertex.
        Parameters:
        vertexToReplaceWith - to use
      • getParentEdge

        DirectedEdge getParentEdge()
        Collect the parent edge of the segment
        Returns:
        parentEdge
      • removeParentEdge

        void removeParentEdge()
        remove the parent edge from this edge segment
      • isDirectionAb

        boolean isDirectionAb()
        check if edge segment runs from vertex a to b or b to a
        Returns:
        true when running from a to b, otherwise false
      • replace

        default boolean replace​(DirectedVertex vertexToReplace,
                                DirectedVertex vertexToReplaceWith)
        Replace one of the vertices of the edge segment
        Parameters:
        vertexToReplace - the vertex to replace
        vertexToReplaceWith - the vertex to replace with
        Returns:
        true when replaced, false otherwise
      • validate

        boolean validate()
        validate the contents of this edge segment
        Returns:
        true when valid, false otherwise
      • clone

        EdgeSegment clone()
        Clone the edge segment
        Returns:
        copy of this instance
      • setParentEdge

        void setParentEdge​(DirectedEdge parentEdge)
        Set the parent edge
        Parameters:
        parentEdge - to set