Interface GraphSegmentList<ST extends GraphSegment<ST,​PT>,​PT extends GraphPoint<PT,​ST>>

  • Type Parameters:
    PT - is the type of node in the graph
    ST - is the type of edge in the graph
    All Superinterfaces:
    Collection<ST>, Iterable<ST>, List<ST>
    All Known Implementing Classes:
    GraphPath, RoadPath

    public interface GraphSegmentList<ST extends GraphSegment<ST,​PT>,​PT extends GraphPoint<PT,​ST>>
    extends List<ST>
    This class describes a path inside a graph.
    Since:
    13.0
    Version:
    17.0 2020-01-04 14:41:42
    Author:
    Stéphane GALLAND
    Maven Group Id:
    org.arakhne.afc.core
    Maven Artifact Id:
    mathgraph
    • Method Detail

      • pointIterator

        @Pure
        Iterator<PT> pointIterator()
        Replies an iterator on the path's points.
        Returns:
        an iterator on the path's points.
      • points

        @Pure
        Iterable<PT> points()
        Replies an iterator on the path's points.
        Returns:
        an iterator on the path's points.
      • add

        boolean add​(ST segment,
                    PT point)
        Add the segment starting from the given point.
        Parameters:
        segment - is the segment to add
        point - is the point at which the path is starting to go through the given segment.
        Returns:
        true on success, otherwise false
      • getLastPoint

        @Pure
        PT getLastPoint()
        Replies the last point.
        Returns:
        the last point.
      • getFirstPoint

        @Pure
        PT getFirstPoint()
        Replies the first point.
        Returns:
        the first point.
      • getLastSegment

        @Pure
        ST getLastSegment()
        Replies the last segment.
        Returns:
        the last segment or null.
      • getAntepenulvianSegment

        @Pure
        ST getAntepenulvianSegment()
        Replies the antepenulvian segment.
        Returns:
        the antepenulvian segment or null.
      • getSecondSegment

        @Pure
        ST getSecondSegment()
        Replies the second element of the path if it exists.
        Returns:
        the second element of the path if it exists.
      • getFirstSegment

        @Pure
        ST getFirstSegment()
        Replies the first segment.
        Returns:
        the first segment or null.
      • removeBefore

        boolean removeBefore​(ST obj)
        Remove the path's elements before the specified one. The specified element will not be removed.
        Parameters:
        obj - the reference object.
        Returns:
        true on success, otherwise false
      • removeBefore

        boolean removeBefore​(ST obj,
                             PT pt)
        Remove the path's elements before the specified one which is starting at the specified point. The specified element will not be removed.
        Parameters:
        obj - the refrence segment.
        pt - is the point on which the segment was connected as its first point.
        Returns:
        true on success, otherwise false
      • removeBeforeLast

        boolean removeBeforeLast​(ST obj)
        Remove the path's elements before the specified one. The specified element will not be removed.
        Parameters:
        obj - the reference object
        Returns:
        true on success, otherwise false
      • removeBeforeLast

        boolean removeBeforeLast​(ST obj,
                                 PT pt)
        Remove the path's elements before the specified one which is starting at the specified point. The specified element will not be removed.
        Parameters:
        obj - the refrence segment.
        pt - is the point on which the segment was connected as its first point.
        Returns:
        true on success, otherwise false
      • removeUntil

        boolean removeUntil​(ST obj)
        Remove the path's elements before the specified one. The specified element will also be removed.
        Parameters:
        obj - the refrence segment.
        Returns:
        true on success, otherwise false
      • removeUntilLast

        boolean removeUntilLast​(ST obj)
        Remove the path's elements before the specified one. The specified element will also be removed.
        Parameters:
        obj - the refrence segment.
        Returns:
        true on success, otherwise false