Last change
on this file since 2645 was 2645, checked in by jttt, 14 years ago |
SearchCompiler refactoring, use search pattern for OsmPrimitive.hasDirectionKeys(), added toString() and type to dataset events
|
-
Property svn:mime-type
set to
text/plain
|
File size:
1.3 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.osm.event;
|
---|
3 |
|
---|
4 | import java.util.List;
|
---|
5 |
|
---|
6 | import org.openstreetmap.josm.data.osm.DataSet;
|
---|
7 | import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
---|
8 |
|
---|
9 |
|
---|
10 | public abstract class AbstractDatasetChangedEvent {
|
---|
11 |
|
---|
12 | public enum DatasetEventType {DATA_CHANGED, NODE_MOVED, PRIMITIVES_ADDED, PRIMITIVES_REMOVED,
|
---|
13 | RELATION_MEMBERS_CHANGED, TAGS_CHANGED, WAY_NODES_CHANGED}
|
---|
14 |
|
---|
15 | protected final DataSet dataSet;
|
---|
16 |
|
---|
17 | protected AbstractDatasetChangedEvent(DataSet dataSet) {
|
---|
18 | this.dataSet = dataSet;
|
---|
19 | }
|
---|
20 |
|
---|
21 | public abstract void fire(DataSetListener listener);
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * Returns list of primitives modified by this event.
|
---|
25 | * <br/>
|
---|
26 | * <strong>WARNING</strong> This value might be incorrect in case
|
---|
27 | * of {@link DataChangedEvent}. It returns all primitives in the dataset
|
---|
28 | * when this method is called (live list), not list of primitives when
|
---|
29 | * the event was created
|
---|
30 | * @return List of modified primitives
|
---|
31 | */
|
---|
32 | public abstract List<? extends OsmPrimitive> getPrimitives();
|
---|
33 |
|
---|
34 | public DataSet getDataset() {
|
---|
35 | return dataSet;
|
---|
36 | }
|
---|
37 |
|
---|
38 | public abstract DatasetEventType getType();
|
---|
39 |
|
---|
40 | @Override
|
---|
41 | public String toString() {
|
---|
42 | return getType().toString();
|
---|
43 | }
|
---|
44 |
|
---|
45 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.