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 | |
---|
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 |
|
---|
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.