Class AllNodesVisitor

java.lang.Object
org.openstreetmap.josm.data.osm.visitor.AllNodesVisitor
All Implemented Interfaces:
OsmPrimitiveVisitor

public class AllNodesVisitor extends Object implements OsmPrimitiveVisitor
Collect all nodes a specific osm primitive has.
  • Field Details

  • Constructor Details

  • Method Details

    • visit

      public void visit(Node n)
      Nodes have only itself as nodes.
      Specified by:
      visit in interface OsmPrimitiveVisitor
      Parameters:
      n - The node to inspect.
    • visit

      public void visit(Way w)
      Ways have their way nodes.
      Specified by:
      visit in interface OsmPrimitiveVisitor
      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:
      visit in interface OsmPrimitiveVisitor
      Parameters:
      e - The relation to inspect.
    • getAllNodes

      public static Collection<Node> getAllNodes(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.