|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.data.APIDataSet
public class APIDataSet
Represents a collection of OsmPrimitive
s which should be uploaded to the
API.
The collection is derived from the modified primitives of an DataSet
and it provides methods
for sorting the objects in upload order.
Nested Class Summary | |
---|---|
private static class |
APIDataSet.RelationUploadDependencyGraph
Utility class to sort a collection of new relations with their dependencies topologically. |
Field Summary | |
---|---|
private java.util.LinkedList<OsmPrimitive> |
toAdd
|
private java.util.LinkedList<OsmPrimitive> |
toDelete
|
private java.util.LinkedList<OsmPrimitive> |
toUpdate
|
Constructor Summary | |
---|---|
APIDataSet()
creates a new empty data set |
|
APIDataSet(java.util.Collection<OsmPrimitive> primitives)
initializes the API data set with the primitives in primitives |
|
APIDataSet(DataSet ds)
initializes the API data set with the modified primitives in ds |
Method Summary | |
---|---|
void |
adjustRelationUploadOrder()
Adjusts the upload order for new relations. |
protected java.util.List<Relation> |
filterRelationsNotReferringToNewRelations(java.util.Collection<Relation> relations)
Replies the subset of relations in relations which are not referring to any
new relation |
java.util.List<OsmPrimitive> |
getPrimitives()
Replies all primitives |
java.util.List<OsmPrimitive> |
getPrimitivesToAdd()
Replies the primitives which should be added to the OSM database |
java.util.List<OsmPrimitive> |
getPrimitivesToDelete()
Replies the primitives which should be deleted in the OSM database |
java.util.List<OsmPrimitive> |
getPrimitivesToUpdate()
Replies the primitives which should be updated in the OSM database |
int |
getSize()
Replies the number of objects to upload |
void |
init(DataSet ds)
initializes the API data set with the modified primitives in ds |
boolean |
isEmpty()
Replies true if there are no primitives to upload |
boolean |
participatesInConflict(Conflict<?> conflict)
Replies true if one of the primitives to be updated or to be deleted participates in the conflict conflict |
boolean |
participatesInConflict(ConflictCollection conflicts)
Replies true if one of the primitives to be updated or to be deleted participates in at least one conflict in conflicts |
void |
removeProcessed(java.util.Collection<IPrimitive> processed)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.LinkedList<OsmPrimitive> toAdd
private java.util.LinkedList<OsmPrimitive> toUpdate
private java.util.LinkedList<OsmPrimitive> toDelete
Constructor Detail |
---|
public APIDataSet()
public APIDataSet(DataSet ds)
ds
ds
- the data set. Ignored, if null.public APIDataSet(java.util.Collection<OsmPrimitive> primitives)
primitives
primitives
- the collection of primitivesMethod Detail |
---|
public void init(DataSet ds)
ds
ds
- the data set. Ignored, if null.public boolean participatesInConflict(Conflict<?> conflict)
conflict
conflict
- the conflict
conflict
public boolean participatesInConflict(ConflictCollection conflicts)
conflicts
conflicts
- the collection of conflicts
conflicts
public boolean isEmpty()
public java.util.List<OsmPrimitive> getPrimitivesToAdd()
public java.util.List<OsmPrimitive> getPrimitivesToUpdate()
public java.util.List<OsmPrimitive> getPrimitivesToDelete()
public java.util.List<OsmPrimitive> getPrimitives()
public int getSize()
public void removeProcessed(java.util.Collection<IPrimitive> processed)
public void adjustRelationUploadOrder() throws CyclicUploadDependencyException
CyclicUploadDependencyException
- thrown, if a cyclic dependency is detectedprotected java.util.List<Relation> filterRelationsNotReferringToNewRelations(java.util.Collection<Relation> relations)
relations
which are not referring to any
new relation
relations
- a list of relations
relations
which are not referring to any
new relation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |