|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.data.osm.history.HistoryDataSet
public class HistoryDataSet
A data set holding histories of OSM primitives.
Field Summary | |
---|---|
private java.util.HashMap<PrimitiveId,java.util.ArrayList<HistoryOsmPrimitive>> |
data
the history data |
private static HistoryDataSet |
historyDataSet
the unique instance |
private java.util.concurrent.CopyOnWriteArrayList<HistoryDataSetListener> |
listeners
|
Constructor Summary | |
---|---|
HistoryDataSet()
|
Method Summary | |
---|---|
void |
activeLayerChange(Layer oldLayer,
Layer newLayer)
Notifies this listener that the active layer has changed. |
void |
addHistoryDataSetListener(HistoryDataSetListener listener)
|
protected void |
fireCacheCleared()
|
protected void |
fireHistoryUpdated(PrimitiveId id)
|
HistoryOsmPrimitive |
get(long id,
OsmPrimitiveType type,
long version)
Replies the history primitive for the primitive with id id
and version version . |
History |
getHistory(long id,
OsmPrimitiveType type)
Replies the history for a given primitive with id id
and type type . |
History |
getHistory(PrimitiveId pid)
Replies the history for a primitive with id id . |
static HistoryDataSet |
getInstance()
Replies the unique instance of the history data set |
void |
layerAdded(Layer newLayer)
Notifies this listener that a layer has been added. |
void |
layerRemoved(Layer oldLayer)
Notifies this listener that a layer has been removed. |
void |
mergeInto(HistoryDataSet other)
merges the histories from the HistoryDataSet other in this history data set |
void |
put(HistoryOsmPrimitive primitive)
Adds a history primitive to the data set |
void |
removeHistoryDataSetListener(HistoryDataSetListener listener)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static HistoryDataSet historyDataSet
private java.util.HashMap<PrimitiveId,java.util.ArrayList<HistoryOsmPrimitive>> data
private java.util.concurrent.CopyOnWriteArrayList<HistoryDataSetListener> listeners
Constructor Detail |
---|
public HistoryDataSet()
Method Detail |
---|
public static HistoryDataSet getInstance()
public void addHistoryDataSetListener(HistoryDataSetListener listener)
public void removeHistoryDataSetListener(HistoryDataSetListener listener)
protected void fireHistoryUpdated(PrimitiveId id)
protected void fireCacheCleared()
public HistoryOsmPrimitive get(long id, OsmPrimitiveType type, long version)
id
and version version
. null, if no such primitive exists.
id
- the id of the primitive. > 0 required.type
- the primitive type. Must not be null.version
- the version of the primitive. > 0 required
id
,
type type
, and version version
public void put(HistoryOsmPrimitive primitive)
primitive
- the history primitive to addpublic History getHistory(long id, OsmPrimitiveType type) throws java.lang.IllegalArgumentException
id
and type type
.
id
- the id the if of the primitive. > 0 requiredtype
- the type of the primitive. Must not be null.
id
and
type
.
java.lang.IllegalArgumentException
- thrown if id <= 0
java.lang.IllegalArgumentException
- thrown if type is nullpublic History getHistory(PrimitiveId pid) throws java.lang.IllegalArgumentException
id
. null, if no
such history exists.
pid
- the primitive id. Must not be null.
id
. null, if no
such history exists
java.lang.IllegalArgumentException
- thrown if pid is nullpublic void mergeInto(HistoryDataSet other)
HistoryDataSet
other in this history data set
other
- the other history data set. Ignored if null.public void activeLayerChange(Layer oldLayer, Layer newLayer)
MapView.LayerChangeListener
activeLayerChange
in interface MapView.LayerChangeListener
oldLayer
- The previous active layernewLayer
- The new activer layerpublic void layerAdded(Layer newLayer)
MapView.LayerChangeListener
layerAdded
in interface MapView.LayerChangeListener
newLayer
- The new added layerpublic void layerRemoved(Layer oldLayer)
MapView.LayerChangeListener
layerRemoved
in interface MapView.LayerChangeListener
oldLayer
- The old removed layer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |