Package org.openstreetmap.josm.actions
Class SelectNonBranchingWaySequences
- java.lang.Object
-
- org.openstreetmap.josm.actions.SelectNonBranchingWaySequences
-
public class SelectNonBranchingWaySequences extends java.lang.Object
Auxiliary class for theSelectNonBranchingWaySequencesAction
.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<Node>
nodes
endpoints of selected waysprivate java.util.Set<Node>
outerNodes
outer endpoints of selected ways
-
Constructor Summary
Constructors Constructor Description SelectNonBranchingWaySequences(java.util.Collection<Way> ways)
Creates a way selection
-
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, outerNodesprivate void
addNodes(Way way)
Add the endpoints of the way to nodes, outerNodesboolean
canExtend()
Find out if the selection can be extendedvoid
extend(DataSet data)
Extend the current selectionprivate 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.
-
-
-
Field Detail
-
outerNodes
private final java.util.Set<Node> outerNodes
outer 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
-
-