1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.osm;
|
---|
3 |
|
---|
4 | import org.openstreetmap.josm.data.coor.CachedLatLon;
|
---|
5 | import org.openstreetmap.josm.data.coor.EastNorth;
|
---|
6 | import org.openstreetmap.josm.data.coor.LatLon;
|
---|
7 |
|
---|
8 | public class NodeData extends PrimitiveData {
|
---|
9 |
|
---|
10 | private final CachedLatLon coor = new CachedLatLon(0, 0);
|
---|
11 |
|
---|
12 | public NodeData() {
|
---|
13 |
|
---|
14 | }
|
---|
15 |
|
---|
16 | public NodeData(double lat, double lon, String... keys) {
|
---|
17 | setCoor(new LatLon(lat, lon));
|
---|
18 | setKeysAsList(keys);
|
---|
19 | }
|
---|
20 |
|
---|
21 | public NodeData(String... keys) {
|
---|
22 | setKeysAsList(keys);
|
---|
23 | }
|
---|
24 |
|
---|
25 | public NodeData(NodeData data) {
|
---|
26 | super(data);
|
---|
27 | setCoor(data.getCoor());
|
---|
28 | }
|
---|
29 |
|
---|
30 | public LatLon getCoor() {
|
---|
31 | return coor;
|
---|
32 | }
|
---|
33 |
|
---|
34 | public void setCoor(LatLon coor) {
|
---|
35 | this.coor.setCoor(coor);
|
---|
36 | }
|
---|
37 |
|
---|
38 | public EastNorth getEastNorth() {
|
---|
39 | return this.coor.getEastNorth();
|
---|
40 | }
|
---|
41 |
|
---|
42 | public void setEastNorth(EastNorth eastNorth) {
|
---|
43 | this.coor.setEastNorth(eastNorth);
|
---|
44 | }
|
---|
45 |
|
---|
46 | @Override
|
---|
47 | public NodeData makeCopy() {
|
---|
48 | return new NodeData(this);
|
---|
49 | }
|
---|
50 |
|
---|
51 | @Override
|
---|
52 | public String toString() {
|
---|
53 | return super.toString() + " NODE " + coor;
|
---|
54 | }
|
---|
55 |
|
---|
56 | @Override
|
---|
57 | public OsmPrimitiveType getType() {
|
---|
58 | return OsmPrimitiveType.NODE;
|
---|
59 | }
|
---|
60 | }
|
---|