Last change
on this file was 36120, checked in by stoecker, 19 months ago |
code cleanup
|
-
Property svn:mime-type
set to
text/plain
|
File size:
1.2 KB
|
Line | |
---|
1 | // License: Public Domain. For details, see LICENSE file.
|
---|
2 | package livegps;
|
---|
3 |
|
---|
4 | import java.util.Collection;
|
---|
5 | import java.util.Collections;
|
---|
6 | import java.util.Map;
|
---|
7 |
|
---|
8 | import org.openstreetmap.josm.data.Bounds;
|
---|
9 | import org.openstreetmap.josm.data.gpx.IGpxTrack;
|
---|
10 | import org.openstreetmap.josm.data.gpx.IGpxTrackSegment;
|
---|
11 | import org.openstreetmap.josm.data.gpx.WithAttributes;
|
---|
12 |
|
---|
13 | /**
|
---|
14 | * LiveGPS track which gets step by step expanded with new data
|
---|
15 | */
|
---|
16 | public class SingleSegmentGpxTrack extends WithAttributes implements IGpxTrack {
|
---|
17 |
|
---|
18 | private final IGpxTrackSegment trackSegment;
|
---|
19 |
|
---|
20 | public SingleSegmentGpxTrack(IGpxTrackSegment trackSegment, Map<String, Object> attributes) {
|
---|
21 | this.attr = Collections.unmodifiableMap(attributes);
|
---|
22 | this.trackSegment = trackSegment;
|
---|
23 | }
|
---|
24 |
|
---|
25 | @Override
|
---|
26 | public Map<String, Object> getAttributes() {
|
---|
27 | return attr;
|
---|
28 | }
|
---|
29 |
|
---|
30 | @Override
|
---|
31 | public Bounds getBounds() {
|
---|
32 | return trackSegment.getBounds();
|
---|
33 | }
|
---|
34 |
|
---|
35 | @Override
|
---|
36 | public Collection<IGpxTrackSegment> getSegments() {
|
---|
37 | return Collections.singleton(trackSegment);
|
---|
38 | }
|
---|
39 |
|
---|
40 | @Override
|
---|
41 | public double length() {
|
---|
42 | return trackSegment.length();
|
---|
43 | }
|
---|
44 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.