source: josm/trunk/src/org/openstreetmap/josm/data/osm/history/HistoryNode.java@ 5346

Last change on this file since 5346 was 5346, checked in by Don-vip, 12 years ago

fix #7867, see #7505, see #7847 - Handle deleted nodes without coordinates in history

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.osm.history;
3
4import java.util.Date;
5
6import org.openstreetmap.josm.data.coor.LatLon;
7import org.openstreetmap.josm.data.osm.Node;
8import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
9import org.openstreetmap.josm.data.osm.User;
10
11/**
12 * Represents an immutable OSM node in the context of a historical view on
13 * OSM data.
14 *
15 */
16public class HistoryNode extends HistoryOsmPrimitive {
17 /** the coordinates. May be null for deleted nodes */
18
19 private LatLon coords;
20
21 public HistoryNode(long id, long version, boolean visible, User user, long changesetId, Date timestamp, LatLon coords) {
22 super(id, version, visible, user, changesetId, timestamp);
23 setCoords(coords);
24 }
25
26 public HistoryNode(Node p) {
27 super(p);
28 setCoords(p.getCoor());
29 }
30
31 @Override
32 public OsmPrimitiveType getType() {
33 return OsmPrimitiveType.NODE;
34 }
35
36 public LatLon getCoords() {
37 return coords;
38 }
39
40 public void setCoords(LatLon coords) {
41 this.coords = coords;
42 }
43
44 @Override
45 public String getDisplayName(HistoryNameFormatter formatter) {
46 return formatter.format(this);
47 }
48}
Note: See TracBrowser for help on using the repository browser.