org.openstreetmap.josm.data.osm
Class ChangesetDataSet

java.lang.Object
  extended by org.openstreetmap.josm.data.osm.ChangesetDataSet

public class ChangesetDataSet
extends java.lang.Object

A ChangesetDataSet holds the content of a changeset.


Nested Class Summary
static interface ChangesetDataSet.ChangesetDataSetEntry
           
static class ChangesetDataSet.ChangesetModificationType
           
private static class ChangesetDataSet.DefaultChangesetDataSetEntry
           
private  class ChangesetDataSet.DefaultIterator
           
 
Field Summary
private  java.util.Map<PrimitiveId,ChangesetDataSet.ChangesetModificationType> modificationTypes
           
private  java.util.Map<PrimitiveId,HistoryOsmPrimitive> primitives
           
 
Constructor Summary
ChangesetDataSet()
           
 
Method Summary
 boolean contains(PrimitiveId id)
          Replies true if the changeset content contains the object with primitive id.
 ChangesetDataSet.ChangesetModificationType getModificationType(PrimitiveId id)
          Replies the modification type for the object with id id.
 HistoryOsmPrimitive getPrimitive(PrimitiveId id)
          Replies the HistoryOsmPrimitive with id id from this dataset.
 java.util.Set<HistoryOsmPrimitive> getPrimitivesByModificationType(ChangesetDataSet.ChangesetModificationType cmt)
          Replies the set of primitives with a specific modification type
 boolean isCreated(PrimitiveId id)
          Replies true if the primitive with id id was created in this changeset.
 boolean isDeleted(PrimitiveId id)
          Replies true if the primitive with id id was deleted in this changeset.
 boolean isUpdated(PrimitiveId id)
          Replies true if the primitive with id id was updated in this changeset.
 java.util.Iterator<ChangesetDataSet.ChangesetDataSetEntry> iterator()
           
 void put(HistoryOsmPrimitive primitive, ChangesetDataSet.ChangesetModificationType cmt)
          Remembers a history primitive with the given modification type
 int size()
          Replies the number of objects in the dataset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

primitives

private final java.util.Map<PrimitiveId,HistoryOsmPrimitive> primitives

modificationTypes

private final java.util.Map<PrimitiveId,ChangesetDataSet.ChangesetModificationType> modificationTypes
Constructor Detail

ChangesetDataSet

public ChangesetDataSet()
Method Detail

put

public void put(HistoryOsmPrimitive primitive,
                ChangesetDataSet.ChangesetModificationType cmt)
         throws java.lang.IllegalArgumentException
Remembers a history primitive with the given modification type

Parameters:
primitive - the primitive. Must not be null.
cmt - the modification type. Must not be null.
Throws:
java.lang.IllegalArgumentException - thrown if primitive is null
java.lang.IllegalArgumentException - thrown if cmt is null

contains

public boolean contains(PrimitiveId id)
Replies true if the changeset content contains the object with primitive id.

Parameters:
id - the id.
Returns:
true if the changeset content contains the object with primitive id

getModificationType

public ChangesetDataSet.ChangesetModificationType getModificationType(PrimitiveId id)
Replies the modification type for the object with id id. Replies null, if id is null or if the object with id id isn't in the changeset content.

Parameters:
id - the id
Returns:
the modification type

isCreated

public boolean isCreated(PrimitiveId id)
Replies true if the primitive with id id was created in this changeset. Replies false, if id is null.

Parameters:
id - the id
Returns:
true if the primitive with id id was created in this changeset.

isUpdated

public boolean isUpdated(PrimitiveId id)
Replies true if the primitive with id id was updated in this changeset. Replies false, if id is null.

Parameters:
id - the id
Returns:
true if the primitive with id id was updated in this changeset.

isDeleted

public boolean isDeleted(PrimitiveId id)
Replies true if the primitive with id id was deleted in this changeset. Replies false, if id is null.

Parameters:
id - the id
Returns:
true if the primitive with id id was deleted in this changeset.

getPrimitivesByModificationType

public java.util.Set<HistoryOsmPrimitive> getPrimitivesByModificationType(ChangesetDataSet.ChangesetModificationType cmt)
                                                                   throws java.lang.IllegalArgumentException
Replies the set of primitives with a specific modification type

Parameters:
cmt - the modification type. Must not be null.
Returns:
the set of primitives
Throws:
java.lang.IllegalArgumentException - thrown if cmt is null

size

public int size()
Replies the number of objects in the dataset

Returns:
the number of objects in the dataset

getPrimitive

public HistoryOsmPrimitive getPrimitive(PrimitiveId id)
Replies the HistoryOsmPrimitive with id id from this dataset. null, if there is no such primitive in the data set.

Parameters:
id - the id
Returns:
the HistoryOsmPrimitive with id id from this dataset

iterator

public java.util.Iterator<ChangesetDataSet.ChangesetDataSetEntry> iterator()


JOSM