|
Last change
on this file since 33078 was 33045, checked in by donvip, 9 years ago |
|
checkstyle
|
-
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.GpxTrack;
|
|---|
| 10 | import org.openstreetmap.josm.data.gpx.GpxTrackSegment;
|
|---|
| 11 | import org.openstreetmap.josm.data.gpx.WithAttributes;
|
|---|
| 12 |
|
|---|
| 13 | public class SingleSegmentGpxTrack extends WithAttributes implements GpxTrack {
|
|---|
| 14 |
|
|---|
| 15 | private final GpxTrackSegment trackSegment;
|
|---|
| 16 |
|
|---|
| 17 | public SingleSegmentGpxTrack(GpxTrackSegment trackSegment, Map<String, Object> attributes) {
|
|---|
| 18 | this.attr = Collections.unmodifiableMap(attributes);
|
|---|
| 19 | this.trackSegment = trackSegment;
|
|---|
| 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 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.