public class ChangesetDataSet extends 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 Map<PrimitiveId,ChangesetDataSet.ChangesetModificationType> |
modificationTypes |
private 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. |
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. |
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 Map<PrimitiveId,HistoryOsmPrimitive> primitives
private final Map<PrimitiveId,ChangesetDataSet.ChangesetModificationType> modificationTypes
public ChangesetDataSet()
public void put(HistoryOsmPrimitive primitive, ChangesetDataSet.ChangesetModificationType cmt) throws IllegalArgumentException
primitive
- the primitive. Must not be null.cmt
- the modification type. Must not be null.IllegalArgumentException
- thrown if primitive is nullIllegalArgumentException
- thrown if cmt is nullpublic boolean contains(PrimitiveId id)
id
.id
- the id.id
public 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 Set<HistoryOsmPrimitive> getPrimitivesByModificationType(ChangesetDataSet.ChangesetModificationType cmt) throws IllegalArgumentException
cmt
- the modification type. Must not be null.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 Iterator<ChangesetDataSet.ChangesetDataSetEntry> iterator()