Last change
on this file since 12116 was 11928, checked in by Don-vip, 7 years ago |
improve unit tests, javadoc
|
-
Property svn:eol-style
set to
native
|
File size:
1.2 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.osm.event;
|
---|
3 |
|
---|
4 | import java.util.Collections;
|
---|
5 | import java.util.List;
|
---|
6 |
|
---|
7 | import org.openstreetmap.josm.data.osm.DataSet;
|
---|
8 | import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
---|
9 | import org.openstreetmap.josm.data.osm.Way;
|
---|
10 |
|
---|
11 | public class WayNodesChangedEvent extends AbstractDatasetChangedEvent {
|
---|
12 |
|
---|
13 | private final Way way;
|
---|
14 |
|
---|
15 | /**
|
---|
16 | * Constructs a new {@code WayNodesChangedEvent}.
|
---|
17 | * @param dataSet the dataset from which the event comes from
|
---|
18 | * @param way the way affected by the change
|
---|
19 | */
|
---|
20 | public WayNodesChangedEvent(DataSet dataSet, Way way) {
|
---|
21 | super(dataSet);
|
---|
22 | this.way = way;
|
---|
23 | }
|
---|
24 |
|
---|
25 | @Override
|
---|
26 | public void fire(DataSetListener listener) {
|
---|
27 | listener.wayNodesChanged(this);
|
---|
28 | }
|
---|
29 |
|
---|
30 | /**
|
---|
31 | * Returns the way affected by the change.
|
---|
32 | * @return the way affected by the change
|
---|
33 | */
|
---|
34 | public Way getChangedWay() {
|
---|
35 | return way;
|
---|
36 | }
|
---|
37 |
|
---|
38 | @Override
|
---|
39 | public List<? extends OsmPrimitive> getPrimitives() {
|
---|
40 | return Collections.singletonList(way);
|
---|
41 | }
|
---|
42 |
|
---|
43 | @Override
|
---|
44 | public DatasetEventType getType() {
|
---|
45 | return DatasetEventType.WAY_NODES_CHANGED;
|
---|
46 | }
|
---|
47 |
|
---|
48 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.