Class PrimitivesAddedEvent
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent
-
- org.openstreetmap.josm.data.osm.event.PrimitivesAddedEvent
-
public class PrimitivesAddedEvent extends AbstractDatasetChangedEvent
An event that is triggered if primitives have been added to the dataset
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent
AbstractDatasetChangedEvent.DatasetEventType
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<? extends OsmPrimitive>primitivesprivate booleanwasIncomplete-
Fields inherited from class org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent
dataSet
-
-
Constructor Summary
Constructors Constructor Description PrimitivesAddedEvent(DataSet dataSet, java.util.Collection<? extends OsmPrimitive> primitives, boolean wasIncomplete)Constructs a newPrimitivesAddedEvent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfire(DataSetListener listener)Calls the appropriate method of the listener for this event.java.util.List<? extends OsmPrimitive>getPrimitives()Returns list of primitives modified by this event.AbstractDatasetChangedEvent.DatasetEventTypegetType()Returns the type of dataset changed event.booleanwasIncomplete()Determines if primitive was in dataset before (so it's not really added), but it was incomplete-
Methods inherited from class org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent
getDataset, toString
-
-
-
-
Field Detail
-
primitives
private final java.util.List<? extends OsmPrimitive> primitives
-
wasIncomplete
private final boolean wasIncomplete
-
-
Constructor Detail
-
PrimitivesAddedEvent
public PrimitivesAddedEvent(DataSet dataSet, java.util.Collection<? extends OsmPrimitive> primitives, boolean wasIncomplete)
Constructs a newPrimitivesAddedEvent.- Parameters:
dataSet- the dataset from which the event comes fromprimitives- the list of primitives affected by the changewasIncomplete-trueif primitive was in dataset before (so it's not really added), but it was incomplete
-
-
Method Detail
-
fire
public void fire(DataSetListener listener)
Description copied from class:AbstractDatasetChangedEventCalls the appropriate method of the listener for this event.- Specified by:
firein classAbstractDatasetChangedEvent- Parameters:
listener- dataset listener to notify about this event
-
getPrimitives
public java.util.List<? extends OsmPrimitive> getPrimitives()
Description copied from class:AbstractDatasetChangedEventReturns list of primitives modified by this event.
WARNING This value might be incorrect in case ofDataChangedEvent. It returns all primitives in the dataset when this method is called (live list), not list of primitives when the event was created- Specified by:
getPrimitivesin classAbstractDatasetChangedEvent- Returns:
- List of modified primitives
-
wasIncomplete
public boolean wasIncomplete()
Determines if primitive was in dataset before (so it's not really added), but it was incomplete- Returns:
trueif primitive was in dataset before (so it's not really added), but it was incomplete
-
getType
public AbstractDatasetChangedEvent.DatasetEventType getType()
Description copied from class:AbstractDatasetChangedEventReturns the type of dataset changed event.- Specified by:
getTypein classAbstractDatasetChangedEvent- Returns:
- the type of dataset changed event
-
-