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

Last change on this file since 30197 was 29769, checked in by akks, 11 years ago

[josm_utilsplugin2. josm_commandline, josm_livegps, josm_reverter, josm_opendata, josm_videomapping]:
rearrange menu items and change menu accelerators, add Netbeans projects, fix some syntax warnings

  • 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
22 @Override
23 public Map<String, Object> getAttributes() {
24 return attr;
25 }
26
27 @Override
28 public Bounds getBounds() {
29 return trackSegment.getBounds();
30 }
31
32 @Override
33 public Collection<GpxTrackSegment> getSegments() {
34 return Collections.singleton(trackSegment);
35 }
36
37 @Override
38 public double length() {
39 return trackSegment.length();
40 }
41
42 @Override
43 public int getUpdateCount() {
44 return trackSegment.getUpdateCount();
45 }
46
47}
Note: See TracBrowser for help on using the repository browser.