Interface EdgeSegments<ES extends EdgeSegment>

  • All Superinterfaces:
    Iterable<ES>
    All Known Subinterfaces:
    LinkSegments<LS>
    All Known Implementing Classes:
    EdgeSegmentsImpl, LinkSegmentsImpl

    public interface EdgeSegments<ES extends EdgeSegment>
    extends Iterable<ES>
    Container and factory class for edge segments in a graph, also to be used to create and register edge segments of any (derived) type
    Author:
    markr
    • Method Detail

      • remove

        void remove​(ES edgeSegment)
        Remove an edges segment
        Parameters:
        edgeSegment - to remove
      • remove

        void remove​(long edgeSegmentId)
        Remove an edge segment by id
        Parameters:
        edgeSegmentId - to remove by id
      • create

        ES create​(DirectedEdge parentEdge,
                  boolean directionAB)
           throws PlanItException
        Create edge segment
        Parameters:
        parentEdge - the parent edge of this edge segment
        directionAB - direction of travel
        Returns:
        the created edge segment
        Throws:
        PlanItException - thrown if there is an error
      • register

        void register​(DirectedEdge parentEdge,
                      ES edgeSegment,
                      boolean directionAB)
               throws PlanItException
        Register a edge segment (not registered on nodes and edge)
        Parameters:
        parentEdge - the parent edge which specified edge segment will be registered on
        edgeSegment - edge segment to be registered
        directionAB - direction of travel
        Throws:
        PlanItException - thrown if there is an error
      • registerNew

        ES registerNew​(DirectedEdge parentEdge,
                       boolean directionAb,
                       boolean registerOnVertexAndEdge)
                throws PlanItException
        Create directional edge segment and register it
        Parameters:
        parentEdge - the parent edge of this edge segment
        directionAb - direction of travel
        registerOnVertexAndEdge - option to register the new edge segment on the underlying edge and its vertices
        Returns:
        the created edge segment
        Throws:
        PlanItException - thrown if there is an error
      • get

        ES get​(long id)
        Get edge segment by id
        Parameters:
        id - id of the edge segment
        Returns:
        retrieved edge Segment
      • getByXmlId

        ES getByXmlId​(String xmlId)
        Return an edge segment by its Xml id
        Parameters:
        xmlId - the XML id of the edge segment
        Returns:
        the specified edge segment instance
      • size

        long size()
        Return number of registered edge segments
        Returns:
        number of registered edge segments
      • registerUniqueCopyOf

        ES registerUniqueCopyOf​(ES edgeSegmentToCopy,
                                DirectedEdge newParent)
        copy the passed in edge segment and register it.
        Parameters:
        edgeSegmentToCopy - as is except for its ids which will be updated to make it uniquely identifiable
        newParent - update the parent edge to passed in edge
        Returns:
        copy of edge segment now registered
      • isEmpty

        default boolean isEmpty()
        check if size is zero
        Returns:
        true when empty, false otherwise