public class ChangesetDataSet extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
ChangesetDataSet.ChangesetDataSetEntry
An entry in the changeset dataset.
|
static class |
ChangesetDataSet.ChangesetModificationType
Type of primitive modification.
|
static class |
ChangesetDataSet.DefaultChangesetDataSetEntry
Class to keep one entry of a changeset: the combination of modification type and primitive.
|
private static class |
ChangesetDataSet.DefaultIterator |
Modifier and Type | Field and Description |
---|---|
private java.util.Map<PrimitiveId,java.lang.Object> |
entryMap
maps an id to either one
ChangesetDataSet.ChangesetDataSetEntry or an array of ChangesetDataSet.ChangesetDataSetEntry |
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 . |
private ChangesetDataSet.ChangesetDataSetEntry |
getEntry(PrimitiveId id,
int n) |
ChangesetDataSet.ChangesetDataSetEntry |
getFirstEntry(PrimitiveId id)
Replies the first
ChangesetDataSet.ChangesetDataSetEntry with id id from this dataset. |
java.util.Set<PrimitiveId> |
getIds() |
ChangesetDataSet.ChangesetDataSetEntry |
getLastEntry(PrimitiveId id)
Replies the last
ChangesetDataSet.ChangesetDataSetEntry with id id from this dataset. |
ChangesetDataSet.ChangesetModificationType |
getModificationType(PrimitiveId id)
Replies the last modification type for the object with id
id . |
HistoryOsmPrimitive |
getPrimitive(PrimitiveId id)
Replies the
HistoryOsmPrimitive with id id from this dataset. |
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()
Returns an iterator over dataset entries.
|
void |
put(HistoryOsmPrimitive primitive,
ChangesetDataSet.ChangesetModificationType cmt)
Remembers a history primitive with the given modification type
|
int |
size()
Replies the number of primitives in the dataset.
|
private final java.util.Map<PrimitiveId,java.lang.Object> entryMap
ChangesetDataSet.ChangesetDataSetEntry
or an array of ChangesetDataSet.ChangesetDataSetEntry
public ChangesetDataSet()
public void put(HistoryOsmPrimitive primitive, ChangesetDataSet.ChangesetModificationType cmt)
primitive
- the primitive. Must not be null.cmt
- the modification type. Must not be null.java.lang.IllegalArgumentException
- if primitive is nulljava.lang.IllegalArgumentException
- if cmt is nulljava.lang.IllegalArgumentException
- if the same primitive was already stored with a higher or equal versionpublic 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 or not in the dataset.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 or not in the dataset.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 or not in the dataset.id
- the idid
was deleted in this
changeset.public 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. If the primitive was modified
multiple times, the last version is returned.id
- the idHistoryOsmPrimitive
with id id
from this datasetpublic java.util.Set<PrimitiveId> getIds()
public ChangesetDataSet.ChangesetDataSetEntry getFirstEntry(PrimitiveId id)
ChangesetDataSet.ChangesetDataSetEntry
with id id
from this dataset.
null, if there is no such primitive in the data set.id
- the idChangesetDataSet.ChangesetDataSetEntry
with id id
from this dataset or null.public ChangesetDataSet.ChangesetDataSetEntry getLastEntry(PrimitiveId id)
ChangesetDataSet.ChangesetDataSetEntry
with id id
from this dataset.
null, if there is no such primitive in the data set.id
- the idChangesetDataSet.ChangesetDataSetEntry
with id id
from this dataset or null.private ChangesetDataSet.ChangesetDataSetEntry getEntry(PrimitiveId id, int n)
public java.util.Iterator<ChangesetDataSet.ChangesetDataSetEntry> iterator()