Class Line

  • All Implemented Interfaces:
    java.lang.Iterable<WayPoint>, java.util.Collection<WayPoint>

    public class Line
    extends java.lang.Object
    implements java.util.Collection<WayPoint>
    Line represents a linear collection of GPX waypoints with the ordered/unordered distinction.
    Since:
    14451
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.awt.Color color  
      private boolean unordered  
      private java.util.Collection<WayPoint> waypoints  
    • Constructor Summary

      Constructors 
      Constructor Description
      Line​(java.util.Collection<WayPoint> waypoints, java.util.Map<java.lang.String,​java.lang.Object> attributes, java.awt.Color color)
      Constructs a new Line.
      Line​(GpxRoute route)
      Constructs a new Line.
      Line​(IGpxTrackSegment trackSegment, java.util.Map<java.lang.String,​java.lang.Object> trackAttributes, java.awt.Color color)
      Constructs a new Line.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(WayPoint e)  
      boolean addAll​(java.util.Collection<? extends WayPoint> c)  
      void clear()  
      boolean contains​(java.lang.Object o)  
      boolean containsAll​(java.util.Collection<?> c)  
      java.awt.Color getColor()
      Returns the track/route color
      boolean isEmpty()  
      boolean isUnordered()
      Determines if waypoints are ordered.
      java.util.Iterator<WayPoint> iterator()  
      boolean remove​(java.lang.Object o)  
      boolean removeAll​(java.util.Collection<?> c)  
      boolean retainAll​(java.util.Collection<?> c)  
      int size()  
      java.lang.Object[] toArray()  
      <T> T[] toArray​(T[] a)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Constructor Detail

      • Line

        public Line​(java.util.Collection<WayPoint> waypoints,
                    java.util.Map<java.lang.String,​java.lang.Object> attributes,
                    java.awt.Color color)
        Constructs a new Line.
        Parameters:
        waypoints - collection of waypoints
        attributes - track/route attributes
        color - color of the track
        Since:
        15496
      • Line

        public Line​(IGpxTrackSegment trackSegment,
                    java.util.Map<java.lang.String,​java.lang.Object> trackAttributes,
                    java.awt.Color color)
        Constructs a new Line.
        Parameters:
        trackSegment - track segment
        trackAttributes - track attributes
        color - color of the track
        Since:
        15496
      • Line

        public Line​(GpxRoute route)
        Constructs a new Line.
        Parameters:
        route - route
    • Method Detail

      • isUnordered

        public boolean isUnordered()
        Determines if waypoints are ordered.
        Returns:
        true if waypoints are ordered
      • getColor

        public java.awt.Color getColor()
        Returns the track/route color
        Returns:
        the color
        Since:
        15496
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<WayPoint>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<WayPoint>
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<WayPoint>
      • iterator

        public java.util.Iterator<WayPointiterator()
        Specified by:
        iterator in interface java.util.Collection<WayPoint>
        Specified by:
        iterator in interface java.lang.Iterable<WayPoint>
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<WayPoint>
      • toArray

        public <T> T[] toArray​(T[] a)
        Specified by:
        toArray in interface java.util.Collection<WayPoint>
      • add

        public boolean add​(WayPoint e)
        Specified by:
        add in interface java.util.Collection<WayPoint>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<WayPoint>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> c)
        Specified by:
        containsAll in interface java.util.Collection<WayPoint>
      • addAll

        public boolean addAll​(java.util.Collection<? extends WayPoint> c)
        Specified by:
        addAll in interface java.util.Collection<WayPoint>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> c)
        Specified by:
        removeAll in interface java.util.Collection<WayPoint>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> c)
        Specified by:
        retainAll in interface java.util.Collection<WayPoint>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<WayPoint>