source: osm/applications/editors/josm/plugins/livegps/src/livegps/SingleSegmentGpxTrack.java@ 20431

Last change on this file since 20431 was 20431, checked in by jttt, 15 years ago

Changes in GpxTrack API - return number of updates

  • Property svn:mime-type set to text/plain
File size: 987 bytes
Line 
1package livegps;
2
3import java.util.Collection;
4import java.util.Collections;
5import java.util.Map;
6
7import org.openstreetmap.josm.data.Bounds;
8import org.openstreetmap.josm.data.gpx.GpxTrack;
9import org.openstreetmap.josm.data.gpx.GpxTrackSegment;
10
11public class SingleSegmentGpxTrack implements GpxTrack {
12
13 private final Map<String, Object> attributes;
14 private final GpxTrackSegment trackSegment;
15
16 public SingleSegmentGpxTrack(GpxTrackSegment trackSegment, Map<String, Object> attributes) {
17 this.attributes = Collections.unmodifiableMap(attributes);
18 this.trackSegment = trackSegment;
19 }
20
21
22 public Map<String, Object> getAttributes() {
23 return attributes;
24 }
25
26 public Bounds getBounds() {
27 return trackSegment.getBounds();
28 }
29
30 public Collection<GpxTrackSegment> getSegments() {
31 return Collections.singleton(trackSegment);
32 }
33
34 public double length() {
35 return trackSegment.length();
36 }
37
38 @Override
39 public int getUpdateCount() {
40 return trackSegment.getUpdateCount();
41 }
42
43}
Note: See TracBrowser for help on using the repository browser.