Interface DirectedEdge

    • Method Detail

      • registerEdgeSegment

        default EdgeSegment registerEdgeSegment​(EdgeSegment edgeSegment,
                                                boolean directionAB)
        Register EdgeSegment. If there already exists an edgeSegment for that direction it is replaced and returned. If the edge segment has no parent edge, this edge is set. If there is a discrepancy between the edge segment's parent edge and this edge a warning is issued and the edge segment is not registered
        Parameters:
        edgeSegment - the edgeSegment to be registered
        directionAB - direction of travel
        Returns:
        replaced egeSegment (if any)
      • registerEdgeSegment

        EdgeSegment registerEdgeSegment​(EdgeSegment edgeSegment,
                                        boolean directionAB,
                                        boolean force)
        Register EdgeSegment. If there already exists an edgeSegment for that direction it is replaced and returned. If the edge segment has no parent edge, this edge is set. If there is a discrepancy between the edge segment's parent edge and this edge a warning is issued and the edge segment is not registered
        Parameters:
        edgeSegment - the edgeSegment to be registered
        directionAB - direction of travel
        force - when true the provided edge segment is always set (even if null or inconsistent, without warning)
        Returns:
        replaced egeSegment (if any)
      • removeEdgeSegments

        default void removeEdgeSegments()
        Remove edge segments from this edge. Be careful doing this as it because it might affect the contiguous ids if the edge segment is garbage collected
      • removeEdgeSegmentAb

        EdgeSegment removeEdgeSegmentAb()
        Remove edge segmentAb from this edge. Be careful doing this as it because it might affect the contiguous ids if the edge segment is garbage collected
        Returns:
        removed edge segment
      • removeEdgeSegmentBa

        EdgeSegment removeEdgeSegmentBa()
        Remove edge segmentAb from this edge. Be careful doing this as it because it might affect the contiguous ids if the edge segment is garbage collected
        Returns:
        removed edge segment
      • getEdgeSegmentAb

        EdgeSegment getEdgeSegmentAb()
        Edge segment in the direction from A to B
        Returns:
        edge segment AB
      • getEdgeSegmentBa

        EdgeSegment getEdgeSegmentBa()
        Edge segment in the direction from B to A
        Returns:
        edge segment BA
      • replace

        void replace​(EdgeSegment edgeSegmentToReplace,
                     EdgeSegment edgeSegmentToReplaceWith)
        replace passed in edge segment (if present) with the passed in one
        Parameters:
        edgeSegmentToReplace - the one to replace
        edgeSegmentToReplaceWith - the one to replace it with
      • getEdgeSegment

        default EdgeSegment getEdgeSegment​(boolean directionAb)
        Edge segment in the direction indicated
        Parameters:
        directionAb - direction of segment
        Returns:
        edge segment if present
      • hasEdgeSegmentBa

        default boolean hasEdgeSegmentBa()
        Verify if edge segment BA exists
        Returns:
        true if present, false otherwise
      • hasEdgeSegmentAb

        default boolean hasEdgeSegmentAb()
        Verify if edge segment BA exists
        Returns:
        true if present, false otherwise
      • hasEdgeSegment

        default boolean hasEdgeSegment()
        Verify if any edge segment exists
        Returns:
        true if present, false otherwise
      • getEdgeSegments

        default Collection<? extends EdgeSegment> getEdgeSegments()
        collect all edge segments available on the edge
        Returns:
        available edge segments
      • forEachSegment

        default <T extends EdgeSegment> void forEachSegment​(Consumer<T> edgeSegmentConsumer)
        Apply consumer to each edge segment of directed egde when present
        Type Parameters:
        T - type of edge segment
        Parameters:
        edgeSegmentConsumer - to apply
      • removeEdgeSegment

        default EdgeSegment removeEdgeSegment​(EdgeSegment edgeSegment)
        Remove given edge segment from edge. If the edge segment is not a child nothing is removed
        Parameters:
        edgeSegment - to remove
        Returns:
        removed edge segment, null if none is removed