Package org.openstreetmap.josm.data.gpx
Class Line
- java.lang.Object
-
- org.openstreetmap.josm.data.gpx.Line
-
- All Implemented Interfaces:
Iterable<WayPoint>
,Collection<WayPoint>
public class Line extends Object implements Collection<WayPoint>
Line represents a linear collection of GPX waypoints with the ordered/unordered distinction.- Since:
- 14451
-
-
Constructor Summary
Constructors Constructor Description Line(Collection<WayPoint> waypoints, Map<String,Object> attributes, Color color)
Constructs a newLine
.Line(GpxRoute route)
Constructs a newLine
.Line(IGpxTrackSegment trackSegment, Map<String,Object> trackAttributes, Color color)
Constructs a newLine
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(WayPoint e)
boolean
addAll(Collection<? extends WayPoint> c)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> c)
Color
getColor()
Returns the track/route colorboolean
isEmpty()
boolean
isUnordered()
Determines if waypoints are ordered.Iterator<WayPoint>
iterator()
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
retainAll(Collection<?> c)
int
size()
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
-
-
-
-
Constructor Detail
-
Line
public Line(Collection<WayPoint> waypoints, Map<String,Object> attributes, Color color)
Constructs a newLine
.- Parameters:
waypoints
- collection of waypointsattributes
- track/route attributescolor
- color of the track- Since:
- 15496
-
Line
public Line(IGpxTrackSegment trackSegment, Map<String,Object> trackAttributes, Color color)
Constructs a newLine
.- Parameters:
trackSegment
- track segmenttrackAttributes
- track attributescolor
- color of the track- Since:
- 15496
-
-
Method Detail
-
isUnordered
public boolean isUnordered()
Determines if waypoints are ordered.- Returns:
true
if waypoints are ordered
-
size
public int size()
- Specified by:
size
in interfaceCollection<WayPoint>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection<WayPoint>
-
contains
public boolean contains(Object o)
- Specified by:
contains
in interfaceCollection<WayPoint>
-
toArray
public Object[] toArray()
- Specified by:
toArray
in interfaceCollection<WayPoint>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interfaceCollection<WayPoint>
-
add
public boolean add(WayPoint e)
- Specified by:
add
in interfaceCollection<WayPoint>
-
remove
public boolean remove(Object o)
- Specified by:
remove
in interfaceCollection<WayPoint>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interfaceCollection<WayPoint>
-
addAll
public boolean addAll(Collection<? extends WayPoint> c)
- Specified by:
addAll
in interfaceCollection<WayPoint>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interfaceCollection<WayPoint>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAll
in interfaceCollection<WayPoint>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<WayPoint>
-
-