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

Last change on this file since 9 was 9, checked in by imi, 19 years ago
  • added support for DataReaders
  • added a nice status line and a tooltip when holding middle mouse button
File size: 1.1 KB
Line 
1package org.openstreetmap.josm.data.osm;
2
3import java.util.Collection;
4import java.util.Collections;
5import java.util.LinkedList;
6
7import org.openstreetmap.josm.data.GeoPoint;
8import org.openstreetmap.josm.data.osm.visitor.Visitor;
9
10
11/**
12 * One node data, consisting of one world coordinate waypoint.
13 *
14 * @author imi
15 */
16public class Node extends OsmPrimitive {
17
18 /**
19 * The coordinates of this node.
20 */
21 public GeoPoint coor;
22
23 /**
24 * The list of line segments, this node is part of.
25 */
26 transient Collection<LineSegment> parentSegment = new LinkedList<LineSegment>();
27
28 /**
29 * Returns a read-only list of all segments this node is in.
30 * @return A list of all segments. Readonly.
31 */
32 public Collection<LineSegment> getParentSegments() {
33 return Collections.unmodifiableCollection(parentSegment);
34 }
35
36 /**
37 * Return a list only this added.
38 */
39 @Override
40 public Collection<Node> getAllNodes() {
41 LinkedList<Node> nodes = new LinkedList<Node>();
42 nodes.add(this);
43 return nodes;
44 }
45
46 @Override
47 public void visit(Visitor visitor) {
48 visitor.visit(this);
49 }
50}
Note: See TracBrowser for help on using the repository browser.