source: josm/src/org/openstreetmap/josm/data/osm/Way.java@ 86

Last change on this file since 86 was 86, checked in by imi, 18 years ago
  • added conflicts and resolve conflict dialog

This is one of those "changed everything" checkpoint.

File size: 1.1 KB
Line 
1package org.openstreetmap.josm.data.osm;
2
3import java.util.ArrayList;
4import java.util.Arrays;
5import java.util.List;
6
7import org.openstreetmap.josm.data.osm.visitor.Visitor;
8
9/**
10 * One full way, consisting of several way segments chained together.
11 *
12 * @author imi
13 */
14public class Way extends OsmPrimitive {
15
16 /**
17 * All way segments in this way
18 */
19 public final List<Segment> segments = new ArrayList<Segment>();
20
21 @Override public void visit(Visitor visitor) {
22 visitor.visit(this);
23 }
24
25 /**
26 * Create an identical clone of the argument (including the id)
27 */
28 public Way(Way clone) {
29 cloneFrom(clone);
30 }
31
32 public Way() {
33 }
34
35 @Override public void cloneFrom(OsmPrimitive osm) {
36 super.cloneFrom(osm);
37 segments.clear();
38 segments.addAll(((Way)osm).segments);
39 }
40
41 @Override public String toString() {
42 return "{Way id="+id+" segments="+Arrays.toString(segments.toArray())+"}";
43 }
44
45 @Override public boolean realEqual(OsmPrimitive osm) {
46 return osm instanceof Way ? super.realEqual(osm) && segments.equals(((Way)osm).segments) : false;
47 }
48}
Note: See TracBrowser for help on using the repository browser.