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 | |
---|
1 | package livegps;
|
---|
2 |
|
---|
3 | import java.util.Collection;
|
---|
4 | import java.util.Collections;
|
---|
5 | import java.util.Map;
|
---|
6 |
|
---|
7 | import org.openstreetmap.josm.data.Bounds;
|
---|
8 | import org.openstreetmap.josm.data.gpx.GpxTrack;
|
---|
9 | import org.openstreetmap.josm.data.gpx.GpxTrackSegment;
|
---|
10 | import org.openstreetmap.josm.data.gpx.WithAttributes;
|
---|
11 |
|
---|
12 | public 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.