Last change
on this file since 298 was 298, checked in by imi, 17 years ago |
- added license description to head of each source file
|
File size:
754 bytes
|
Line | |
---|
1 | // License: GPL. Copyright 2007 by Immanuel Scholz and others
|
---|
2 | /**
|
---|
3 | */
|
---|
4 | package org.openstreetmap.josm.data.osm.visitor;
|
---|
5 |
|
---|
6 | import org.openstreetmap.josm.data.osm.DataSet;
|
---|
7 | import org.openstreetmap.josm.data.osm.Segment;
|
---|
8 | import org.openstreetmap.josm.data.osm.Node;
|
---|
9 | import org.openstreetmap.josm.data.osm.Way;
|
---|
10 |
|
---|
11 | /**
|
---|
12 | * Visitor, that adds the visited object to the dataset given at constructor.
|
---|
13 | *
|
---|
14 | * Is not capable of adding keys.
|
---|
15 | *
|
---|
16 | * @author imi
|
---|
17 | */
|
---|
18 | public class DeleteVisitor implements Visitor {
|
---|
19 |
|
---|
20 | private final DataSet ds;
|
---|
21 |
|
---|
22 | public DeleteVisitor(DataSet ds) {
|
---|
23 | this.ds = ds;
|
---|
24 | }
|
---|
25 |
|
---|
26 | public void visit(Node n) {
|
---|
27 | ds.nodes.remove(n);
|
---|
28 | }
|
---|
29 | public void visit(Segment ls) {
|
---|
30 | ds.segments.remove(ls);
|
---|
31 | }
|
---|
32 | public void visit(Way w) {
|
---|
33 | ds.ways.remove(w);
|
---|
34 | }
|
---|
35 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.