org.openstreetmap.josm.data.osm.visitor
Class AllNodesVisitor

java.lang.Object
  extended by org.openstreetmap.josm.data.osm.visitor.AbstractVisitor
      extended by org.openstreetmap.josm.data.osm.visitor.AllNodesVisitor
All Implemented Interfaces:
Visitor

public class AllNodesVisitor
extends AbstractVisitor

Collect all nodes a specific osm primitive has.


Field Summary
 java.util.Collection<Node> nodes
          The resulting nodes collected so far.
 
Constructor Summary
AllNodesVisitor()
           
 
Method Summary
static java.util.Collection<Node> getAllNodes(java.util.Collection<? extends OsmPrimitive> osms)
           
 void visit(Node n)
          Nodes have only itself as nodes.
 void visit(Relation e)
          Relations may have any number of nodes.
 void visit(Way w)
          Ways have their way nodes.
 
Methods inherited from class org.openstreetmap.josm.data.osm.visitor.AbstractVisitor
visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodes

public java.util.Collection<Node> nodes
The resulting nodes collected so far.

Constructor Detail

AllNodesVisitor

public AllNodesVisitor()
Method Detail

visit

public void visit(Node n)
Nodes have only itself as nodes.

Parameters:
n - The node to inspect.

visit

public void visit(Way w)
Ways have their way nodes.

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!

Parameters:
e - The relation to inspect.

getAllNodes

public static java.util.Collection<Node> getAllNodes(java.util.Collection<? extends OsmPrimitive> osms)
Returns:
All nodes the given primitive has.


JOSM