Last change
on this file since 7005 was 7005, checked in by Don-vip, 10 years ago |
see #8465 - use diamond operator where applicable
|
-
Property svn:eol-style
set to
native
|
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.ArrayList;
|
---|
5 | import java.util.Collection;
|
---|
6 | import java.util.Collections;
|
---|
7 | import java.util.List;
|
---|
8 |
|
---|
9 | import org.openstreetmap.josm.data.osm.DataSet;
|
---|
10 | import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
---|
11 |
|
---|
12 | public class PrimitivesRemovedEvent extends AbstractDatasetChangedEvent {
|
---|
13 |
|
---|
14 | private final List<? extends OsmPrimitive> primitives;
|
---|
15 | private final boolean wasComplete;
|
---|
16 |
|
---|
17 | public PrimitivesRemovedEvent(DataSet dataSet, Collection<? extends OsmPrimitive> primitives, boolean wasComplete) {
|
---|
18 | super(dataSet);
|
---|
19 | this.primitives = Collections.unmodifiableList(new ArrayList<>(primitives));
|
---|
20 | this.wasComplete = wasComplete;
|
---|
21 | }
|
---|
22 |
|
---|
23 | @Override
|
---|
24 | public void fire(DataSetListener listener) {
|
---|
25 | listener.primitivesRemoved(this);
|
---|
26 | }
|
---|
27 |
|
---|
28 | @Override
|
---|
29 | public List<? extends OsmPrimitive> getPrimitives() {
|
---|
30 | return primitives;
|
---|
31 | }
|
---|
32 |
|
---|
33 | /**
|
---|
34 | *
|
---|
35 | * @return True if primitive wasn't really removed from the dataset, it only become incomplete again
|
---|
36 | */
|
---|
37 | public boolean wasComplete() {
|
---|
38 | return wasComplete;
|
---|
39 | }
|
---|
40 |
|
---|
41 | @Override
|
---|
42 | public DatasetEventType getType() {
|
---|
43 | return DatasetEventType.PRIMITIVES_REMOVED;
|
---|
44 | }
|
---|
45 |
|
---|
46 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.