source: josm/trunk/src/org/openstreetmap/josm/data/osm/visitor/DeleteVisitor.java@ 655

Last change on this file since 655 was 655, checked in by ramack, 16 years ago

patch by bruce89, closes #812; thanks bruce

  • Property svn:eol-style set to native
File size: 746 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 DeleteVisitor implements Visitor {
17
18 private final DataSet ds;
19
20 public DeleteVisitor(DataSet ds) {
21 this.ds = ds;
22 }
23
24 public void visit(Node n) {
25 ds.nodes.remove(n);
26 }
27 public void visit(Way w) {
28 ds.ways.remove(w);
29 }
30 public void visit(Relation e) {
31 ds.relations.remove(e);
32 }
33}
Note: See TracBrowser for help on using the repository browser.