Class AllNodesVisitor
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.visitor.AllNodesVisitor
-
- All Implemented Interfaces:
OsmPrimitiveVisitor
public class AllNodesVisitor extends java.lang.Object implements OsmPrimitiveVisitor
Collect all nodes a specific osm primitive has.
-
-
Constructor Summary
Constructors Constructor Description AllNodesVisitor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.Collection<Node>getAllNodes(java.util.Collection<? extends OsmPrimitive> osms)Replies all nodes contained by the given primitivesvoidvisit(Node n)Nodes have only itself as nodes.voidvisit(Relation e)Relations may have any number of nodes.voidvisit(Way w)Ways have their way nodes.
-
-
-
Constructor Detail
-
AllNodesVisitor
public AllNodesVisitor()
-
-
Method Detail
-
visit
public void visit(Node n)
Nodes have only itself as nodes.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Parameters:
n- The node to inspect.
-
visit
public void visit(Way w)
Ways have their way nodes.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Parameters:
w- The way to inspect.
-
visit
public void visit(Relation e)
Relations may have any number of nodes. FIXME: do we want to collect nodes from segs/ways that are relation members? if so, use AutomatchVisitor!- Specified by:
visitin interfaceOsmPrimitiveVisitor- Parameters:
e- The relation to inspect.
-
getAllNodes
public static java.util.Collection<Node> getAllNodes(java.util.Collection<? extends OsmPrimitive> osms)
Replies all nodes contained by the given primitives- Parameters:
osms- The OSM primitives to inspect- Returns:
- All nodes the given primitives have.
-
-