Package org.openstreetmap.josm.data
Class APIDataSet.RelationUploadDependencyGraph
- java.lang.Object
-
- org.openstreetmap.josm.data.APIDataSet.RelationUploadDependencyGraph
-
- Enclosing class:
- APIDataSet
private static class APIDataSet.RelationUploadDependencyGraph extends java.lang.Object
Utility class to sort a collection of new relations with their dependencies topologically.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<Relation,java.util.Set<Relation>>
children
private boolean
newOrUndeleted
private java.util.Collection<Relation>
relations
private java.util.List<Relation>
uploadOrder
private java.util.Set<Relation>
visited
-
Constructor Summary
Constructors Constructor Description RelationUploadDependencyGraph(java.util.Collection<Relation> relations, boolean newOrUndeleted)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDependency(Relation relation, Relation child)
void
build(java.util.Collection<Relation> relations)
java.util.List<Relation>
computeUploadOrder(boolean reverse)
java.util.Set<Relation>
getChildren(Relation relation)
protected void
visit(java.util.Stack<Relation> path, Relation current)
-
-
-
Field Detail
-
uploadOrder
private java.util.List<Relation> uploadOrder
-
newOrUndeleted
private final boolean newOrUndeleted
-
-
Constructor Detail
-
RelationUploadDependencyGraph
RelationUploadDependencyGraph(java.util.Collection<Relation> relations, boolean newOrUndeleted)
-
-
Method Detail
-
getChildren
public java.util.Set<Relation> getChildren(Relation relation)
-
addDependency
public void addDependency(Relation relation, Relation child)
-
visit
protected void visit(java.util.Stack<Relation> path, Relation current) throws CyclicUploadDependencyException
- Throws:
CyclicUploadDependencyException
-
computeUploadOrder
public java.util.List<Relation> computeUploadOrder(boolean reverse) throws CyclicUploadDependencyException
- Throws:
CyclicUploadDependencyException
-
-