source: josm/trunk/src/org/openstreetmap/josm/data/osm/event/PrimitivesAddedEvent.java@ 7005

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.
2package org.openstreetmap.josm.data.osm.event;
3
4import java.util.ArrayList;
5import java.util.Collection;
6import java.util.Collections;
7import java.util.List;
8
9import org.openstreetmap.josm.data.osm.DataSet;
10import org.openstreetmap.josm.data.osm.OsmPrimitive;
11
12public class PrimitivesAddedEvent extends AbstractDatasetChangedEvent {
13
14 private final List<? extends OsmPrimitive> primitives;
15 private final boolean wasIncomplete;
16
17 public PrimitivesAddedEvent(DataSet dataSet, Collection<? extends OsmPrimitive> primitives, boolean wasIncomplete) {
18 super(dataSet);
19 this.primitives = Collections.unmodifiableList(new ArrayList<>(primitives));
20 this.wasIncomplete = wasIncomplete;
21 }
22
23 @Override
24 public void fire(DataSetListener listener) {
25 listener.primitivesAdded(this);
26 }
27
28 @Override
29 public List<? extends OsmPrimitive> getPrimitives() {
30 return primitives;
31 }
32
33 /**
34 *
35 * @return True if primitive was in dataset before (so it's not really added), but it was incomplete
36 */
37 public boolean wasIncomplete() {
38 return wasIncomplete;
39 }
40
41 @Override
42 public DatasetEventType getType() {
43 return DatasetEventType.PRIMITIVES_ADDED;
44 }
45
46}
Note: See TracBrowser for help on using the repository browser.