Package org.openstreetmap.josm.actions
Class UploadSelectionAction.UploadHullBuilder
- java.lang.Object
-
- org.openstreetmap.josm.actions.UploadSelectionAction.UploadHullBuilder
-
- All Implemented Interfaces:
OsmPrimitiveVisitor
- Enclosing class:
- UploadSelectionAction
static class UploadSelectionAction.UploadHullBuilder extends java.lang.Object implements OsmPrimitiveVisitor
Computes the collection of primitives to upload, given a collection of candidate primitives. Some of the candidates are excluded, i.e. if they aren't modified. Other primitives are added. A typical case is a primitive which is new and and which is referred by a modified relation. In order to upload the relation the new primitive has to be uploaded as well, even if it isn't included in the list of candidate primitives.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<OsmPrimitive>
hull
-
Constructor Summary
Constructors Constructor Description UploadHullBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<OsmPrimitive>
build(java.util.Collection<OsmPrimitive> base)
Builds the "hull" of primitives to be uploaded given a base collection of osm primitives.void
visit(Node n)
Visiting call for points.void
visit(Relation r)
Visiting call for relations.void
visit(Way w)
Visiting call for lines.
-
-
-
Field Detail
-
hull
private java.util.Set<OsmPrimitive> hull
-
-
Constructor Detail
-
UploadHullBuilder
UploadHullBuilder()
-
-
Method Detail
-
visit
public void visit(Node n)
Description copied from interface:OsmPrimitiveVisitor
Visiting call for points.- Specified by:
visit
in interfaceOsmPrimitiveVisitor
- Parameters:
n
- The node to inspect.
-
visit
public void visit(Way w)
Description copied from interface:OsmPrimitiveVisitor
Visiting call for lines.- Specified by:
visit
in interfaceOsmPrimitiveVisitor
- Parameters:
w
- The way to inspect.
-
visit
public void visit(Relation r)
Description copied from interface:OsmPrimitiveVisitor
Visiting call for relations.- Specified by:
visit
in interfaceOsmPrimitiveVisitor
- Parameters:
r
- The relation to inspect.
-
build
public java.util.Set<OsmPrimitive> build(java.util.Collection<OsmPrimitive> base)
Builds the "hull" of primitives to be uploaded given a base collection of osm primitives.- Parameters:
base
- the base collection. Must not be null.- Returns:
- the "hull"
- Throws:
java.lang.IllegalArgumentException
- if base is null
-
-