public class ChangesetDataSet extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ChangesetDataSet.ChangesetDataSetEntry |
static class |
ChangesetDataSet.ChangesetModificationType |
private static class |
ChangesetDataSet.DefaultChangesetDataSetEntry |
private class |
ChangesetDataSet.DefaultIterator |
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<PrimitiveId,ChangesetDataSet.ChangesetModificationType> |
modificationTypes |
private java.util.Map<PrimitiveId,HistoryOsmPrimitive> |
primitives |
| Constructor and Description |
|---|
ChangesetDataSet() |
| Modifier and Type | Method and Description |
|---|---|
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
|
private final java.util.Map<PrimitiveId,HistoryOsmPrimitive> primitives
private final java.util.Map<PrimitiveId,ChangesetDataSet.ChangesetModificationType> modificationTypes
public ChangesetDataSet()
public void put(HistoryOsmPrimitive primitive, ChangesetDataSet.ChangesetModificationType cmt) throws java.lang.IllegalArgumentException
primitive - the primitive. Must not be null.cmt - the modification type. Must not be null.java.lang.IllegalArgumentException - thrown if primitive is nulljava.lang.IllegalArgumentException - thrown if cmt is nullpublic boolean contains(PrimitiveId id)
id.id - the id.idpublic ChangesetDataSet.ChangesetModificationType getModificationType(PrimitiveId id)
id. Replies null, if id is null or
if the object with id id isn't in the changeset content.id - the idpublic boolean isCreated(PrimitiveId id)
id was created in this
changeset. Replies false, if id is null.id - the idid was created in this
changeset.public boolean isUpdated(PrimitiveId id)
id was updated in this
changeset. Replies false, if id is null.id - the idid was updated in this
changeset.public boolean isDeleted(PrimitiveId id)
id was deleted in this
changeset. Replies false, if id is null.id - the idid was deleted in this
changeset.public java.util.Set<HistoryOsmPrimitive> getPrimitivesByModificationType(ChangesetDataSet.ChangesetModificationType cmt) throws java.lang.IllegalArgumentException
cmt - the modification type. Must not be null.java.lang.IllegalArgumentException - thrown if cmt is nullpublic int size()
public HistoryOsmPrimitive getPrimitive(PrimitiveId id)
HistoryOsmPrimitive with id id from this
dataset. null, if there is no such primitive in the data set.id - the idHistoryOsmPrimitive with id id from this
datasetpublic java.util.Iterator<ChangesetDataSet.ChangesetDataSetEntry> iterator()