Class TrackSegment

    • Method Detail

      • getPoints

        public List<WayPointgetPoints()
        Return the track-points of this segment.
        Returns:
        the track-points of this segment
      • getExtensions

        public Optional<DocumentgetExtensions()
        Return the (cloned) extensions document. The root element of the returned document has the name extensions.
        
         <extensions>
             ...
         </extensions>
         
        Returns:
        the extensions document
        Throws:
        DOMException - if the document could not be cloned, because of an erroneous XML configuration
        Since:
        1.5
      • toBuilder

        public TrackSegment.Builder toBuilder()
        Convert the immutable track-segment object into a mutable builder initialized with the current track-segment values.
        Returns:
        a new track-segment builder initialized with the values of this track-segment
        Since:
        1.1
      • isEmpty

        public boolean isEmpty()
        Return true if this track-segment doesn't contain any track-point.
        Returns:
        true if this track-segment is empty, false otherwise
      • nonEmpty

        public boolean nonEmpty()
        Return true if this track-segment contains at least one track-point.
        Returns:
        true if this track-segment is not empty, false otherwise
        Since:
        1.1
      • of

        public static TrackSegment of​(List<WayPoint> points,
                                      Document extensions)
        Create a new track-segment with the given points.
        Parameters:
        points - the points of the track-segment
        extensions - the extensions document
        Returns:
        a new track-segment with the given points
        Throws:
        NullPointerException - if the given points sequence is null
        Since:
        1.5
      • of

        public static TrackSegment of​(List<WayPoint> points)
        Create a new track-segment with the given points.
        Parameters:
        points - the points of the track-segment
        Returns:
        a new track-segment with the given points
        Throws:
        NullPointerException - if the given points sequence is null