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 Object
Utility class to sort a collection of new relations with their dependencies topologically.
-
-
Field Summary
Fields Modifier and Type Field Description private Map<Relation,Set<Relation>>
children
private boolean
newOrUndeleted
private Collection<Relation>
relations
private List<Relation>
uploadOrder
private Set<Relation>
visited
-
Constructor Summary
Constructors Constructor Description RelationUploadDependencyGraph(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(Collection<Relation> relations)
List<Relation>
computeUploadOrder(boolean reverse)
Set<Relation>
getChildren(Relation relation)
protected void
visit(Stack<Relation> path, Relation current)
-
-
-
Field Detail
-
relations
private Collection<Relation> relations
-
uploadOrder
private List<Relation> uploadOrder
-
newOrUndeleted
private final boolean newOrUndeleted
-
-
Constructor Detail
-
RelationUploadDependencyGraph
RelationUploadDependencyGraph(Collection<Relation> relations, boolean newOrUndeleted)
-
-
Method Detail
-
build
public final void build(Collection<Relation> relations)
-
getChildren
public Set<Relation> getChildren(Relation relation)
-
addDependency
public void addDependency(Relation relation, Relation child)
-
visit
protected void visit(Stack<Relation> path, Relation current) throws CyclicUploadDependencyException
- Throws:
CyclicUploadDependencyException
-
computeUploadOrder
public List<Relation> computeUploadOrder(boolean reverse) throws CyclicUploadDependencyException
- Throws:
CyclicUploadDependencyException
-
-