Interface EdgeSegment

    • Field Detail

      • EDGE_SEGMENT_ID_CLASS

        static final Class<EdgeSegment> EDGE_SEGMENT_ID_CLASS
        id class for generating ids
    • 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
      • validate

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

        EdgeSegment clone()
        Clone the edge segment
        Specified by:
        clone in interface IdAble
        Returns:
        copy of this instance
      • setParent

        void setParent​(DirectedEdge parentEdge)
        Set the parent edge
        Parameters:
        parentEdge - to set
      • getIdClass

        default Class<EdgeSegment> getIdClass()
        All edges use the EDGE_SEGMENT_ID_CLASS to generate the unique internal ids
        Specified by:
        getIdClass in interface ManagedId
        Returns:
        idClass to use for generating ids for instances of this idable derived class
      • 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
      • hasParentName

        default boolean hasParentName()
        verify if parent (edge) has a name
        Returns:
        true when present, false otherwise
      • getParentName

        default String getParentName()
        verify if parent (edge) has a name
        Returns:
        true when present, false otherwise