Class DataChangedEvent
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent
-
- org.openstreetmap.josm.data.osm.event.DataChangedEvent
-
public class DataChangedEvent extends AbstractDatasetChangedEvent
A combined data change event. It consists of multiple dataset events.
-
-
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<AbstractDatasetChangedEvent>
events
-
Fields inherited from class org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent
dataSet
-
-
Constructor Summary
Constructors Constructor Description DataChangedEvent(DataSet dataSet)
Constructs a newDataChangedEvent
DataChangedEvent(DataSet dataSet, java.util.List<AbstractDatasetChangedEvent> events)
Constructs a newDataChangedEvent
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fire(DataSetListener listener)
Calls the appropriate method of the listener for this event.java.util.List<AbstractDatasetChangedEvent>
getEvents()
Returns list of events that caused this DataChangedEvent.java.util.Collection<OsmPrimitive>
getPrimitives()
Returns list of primitives modified by this event.AbstractDatasetChangedEvent.DatasetEventType
getType()
Returns the type of dataset changed event.-
Methods inherited from class org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent
getDataset, toString
-
-
-
-
Field Detail
-
events
private final java.util.List<AbstractDatasetChangedEvent> events
-
-
Constructor Detail
-
DataChangedEvent
public DataChangedEvent(DataSet dataSet, java.util.List<AbstractDatasetChangedEvent> events)
Constructs a newDataChangedEvent
- Parameters:
dataSet
- the dataset from which the event comes fromevents
- list of change events
-
DataChangedEvent
public DataChangedEvent(DataSet dataSet)
Constructs a newDataChangedEvent
- Parameters:
dataSet
- data set. Can be null
-
-
Method Detail
-
fire
public void fire(DataSetListener listener)
Description copied from class:AbstractDatasetChangedEvent
Calls the appropriate method of the listener for this event.- Specified by:
fire
in classAbstractDatasetChangedEvent
- Parameters:
listener
- dataset listener to notify about this event
-
getPrimitives
public java.util.Collection<OsmPrimitive> getPrimitives()
Description copied from class:AbstractDatasetChangedEvent
Returns 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:
getPrimitives
in classAbstractDatasetChangedEvent
- Returns:
- List of modified primitives
-
getType
public AbstractDatasetChangedEvent.DatasetEventType getType()
Description copied from class:AbstractDatasetChangedEvent
Returns the type of dataset changed event.- Specified by:
getType
in classAbstractDatasetChangedEvent
- Returns:
- the type of dataset changed event
-
getEvents
public java.util.List<AbstractDatasetChangedEvent> getEvents()
Returns list of events that caused this DataChangedEvent.- Returns:
- List of events that caused this DataChangedEvent. Might be null
-
-