|
Last change
on this file since 20431 was 20431, checked in by jttt, 16 years ago |
|
Changes in GpxTrack API - return number of updates
|
-
Property svn:mime-type
set to
text/plain
|
|
File size:
987 bytes
|
| 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 |
|
|---|
| 11 | public 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.