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

Last change on this file since 33009 was 33009, checked in by donvip, 8 years ago

remove duplicated files

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