Class SelectNonBranchingWaySequences

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Set<Node> nodes
      endpoints of selected ways
      private java.util.Set<Node> outerNodes
      outer endpoints of selected ways
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addNodes​(Node node)
      Add a way endpoint to nodes, outerNodes
      private void addNodes​(Way way)
      Add the endpoints of the way to nodes, outerNodes
      boolean canExtend()
      Find out if the selection can be extended
      void extend​(DataSet data)
      Extend the current selection
      private Way findWay​(java.util.Collection<OsmPrimitive> selection)
      Finds out if the current selection can be extended.
      private static Way findWay​(java.util.Collection<OsmPrimitive> selection, Node node)
      Finds out if the current selection can be extended.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • outerNodes

        private final java.util.Set<Node> outerNodes
        outer endpoints of selected ways
      • nodes

        private final java.util.Set<Node> nodes
        endpoints of selected ways
    • Constructor Detail

      • SelectNonBranchingWaySequences

        public SelectNonBranchingWaySequences​(java.util.Collection<Way> ways)
        Creates a way selection
        Parameters:
        ways - selection a selection of ways
    • Method Detail

      • addNodes

        private void addNodes​(Node node)
        Add a way endpoint to nodes, outerNodes
        Parameters:
        node - a way endpoint
      • addNodes

        private void addNodes​(Way way)
        Add the endpoints of the way to nodes, outerNodes
        Parameters:
        way - a way whose endpoints are added
      • canExtend

        public boolean canExtend()
        Find out if the selection can be extended
        Returns:
        true if the selection can be extended
      • findWay

        private static Way findWay​(java.util.Collection<OsmPrimitive> selection,
                                   Node node)
        Finds out if the current selection can be extended.
        Parameters:
        selection - current selection (ways and others)
        node - perimeter node from which to extend the selection
        Returns:
        a way by which to extend the selection, or null
      • findWay

        private Way findWay​(java.util.Collection<OsmPrimitive> selection)
        Finds out if the current selection can be extended.

        The members outerNodes, nodes must have been initialized. How to update these members when extending the selection, @see extend().

        Parameters:
        selection - current selection
        Returns:
        a way by which to extend the selection, or null
      • extend

        public void extend​(DataSet data)
        Extend the current selection
        Parameters:
        data - the data set in which to extend the selection