source: josm/trunk/src/org/openstreetmap/josm/data/osm/visitor/AddVisitor.java@ 627

Last change on this file since 627 was 627, checked in by framm, 16 years ago
  • Property svn:eol-style set to native
File size: 734 bytes
Line 
1// License: GPL. Copyright 2007 by Immanuel Scholz and others
2package org.openstreetmap.josm.data.osm.visitor;
3
4import org.openstreetmap.josm.data.osm.DataSet;
5import org.openstreetmap.josm.data.osm.Relation;
6import org.openstreetmap.josm.data.osm.Node;
7import org.openstreetmap.josm.data.osm.Way;
8
9/**
10 * Visitor, that adds the visited object to the dataset given at constructor.
11 *
12 * Is not capable of adding keys.
13 *
14 * @author imi
15 */
16public class AddVisitor implements Visitor {
17
18 protected final DataSet ds;
19
20 public AddVisitor(DataSet ds) {
21 this.ds = ds;
22 }
23
24 public void visit(Node n) {
25 ds.nodes.add(n);
26 }
27 public void visit(Way w) {
28 ds.ways.add(w);
29 }
30 public void visit(Relation e) {
31 ds.relations.add(e);
32 }
33}
Note: See TracBrowser for help on using the repository browser.