source: josm/src/org/openstreetmap/josm/data/osm/Node.java@ 6

Last change on this file since 6 was 6, checked in by imi, 19 years ago
  • pretty preferrences menu
  • drawing double circles on double position hit
  • mergeNodes option
File size: 767 bytes
Line 
1package org.openstreetmap.josm.data.osm;
2
3import org.openstreetmap.josm.data.GeoPoint;
4
5
6/**
7 * One node data, consisting of one world coordinate waypoint.
8 *
9 * @author imi
10 */
11public class Node extends OsmPrimitive {
12
13 /**
14 * The coordinates of this node.
15 */
16 public GeoPoint coor;
17
18 /**
19 * Nodes are equal when their coordinates are equal.
20 */
21 @Override
22 public boolean equals(Object obj) {
23 if (!(obj instanceof Node))
24 return false;
25 Node n = (Node)obj;
26 if (coor == null)
27 return n.coor == null;
28 return coor.equals(n.coor) && super.equals(obj);
29 }
30
31 /**
32 * Compute the hashcode from the OsmPrimitive's hash and the coor's hash.
33 */
34 @Override
35 public int hashCode() {
36 return (coor == null ? 0 : coor.hashCode()) + super.hashCode();
37 }
38
39
40}
Note: See TracBrowser for help on using the repository browser.