Class EdgeSegmentImpl

    • Constructor Detail

      • EdgeSegmentImpl

        protected EdgeSegmentImpl​(IdGroupingToken groupId,
                                  DirectedEdge parentEdge,
                                  boolean directionAB)
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        parentEdge - parent edge of segment
        directionAB - direction of travel
      • EdgeSegmentImpl

        protected EdgeSegmentImpl​(IdGroupingToken groupId,
                                  boolean directionAB)
        Constructor (without setting parent edge)
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        directionAB - direction of travel
      • EdgeSegmentImpl

        protected EdgeSegmentImpl​(EdgeSegmentImpl edgeSegmentImpl)
        Copy constructor
        Parameters:
        edgeSegmentImpl - to copy
    • Method Detail

      • remove

        public boolean remove​(DirectedVertex vertex)
        Remove the vertex from the edge segment if it is either the up or downstream vertex
        Specified by:
        remove in interface EdgeSegment
        Parameters:
        vertex - to remove
        Returns:
        true when successful, false otherwise
      • setDownstreamVertex

        public void setDownstreamVertex​(DirectedVertex downstreamVertex)
        Set another downstream vertex.
        Specified by:
        setDownstreamVertex in interface EdgeSegment
        Parameters:
        downstreamVertex - to use
      • setUpstreamVertex

        public void setUpstreamVertex​(DirectedVertex upstreamVertex)
        Set another upstream vertex.
        Specified by:
        setUpstreamVertex in interface EdgeSegment
        Parameters:
        upstreamVertex - to use
      • isDirectionAb

        public boolean isDirectionAb()
        check if edge segment runs from vertex a to b or b to a
        Specified by:
        isDirectionAb in interface EdgeSegment
        Returns:
        true when running from a to b, otherwise false
      • setParent

        public void setParent​(DirectedEdge parentEdge)
        Set the parent edge
        Specified by:
        setParent in interface EdgeSegment
        Parameters:
        parentEdge - to set
      • removeParentEdge

        public void removeParentEdge()
        remove the parent edge from this edge segment
        Specified by:
        removeParentEdge in interface EdgeSegment
      • validate

        public boolean validate()
        validate the contents of this edge segment
        Specified by:
        validate in interface EdgeSegment
        Returns:
        true when valid, false otherwise