org.openstreetmap.josm.actions
Class CombineWayAction.NodeGraph
java.lang.Object
org.openstreetmap.josm.actions.CombineWayAction.NodeGraph
- Enclosing class:
- CombineWayAction
public static class CombineWayAction.NodeGraph
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
edges
private java.util.Set<CombineWayAction.NodePair> edges
numUndirectedEges
private int numUndirectedEges
successors
private java.util.HashMap<Node,java.util.List<CombineWayAction.NodePair>> successors
predecessors
private java.util.HashMap<Node,java.util.List<CombineWayAction.NodePair>> predecessors
CombineWayAction.NodeGraph
public CombineWayAction.NodeGraph()
buildNodePairs
public static java.util.List<CombineWayAction.NodePair> buildNodePairs(Way way,
boolean directed)
buildNodePairs
public static java.util.List<CombineWayAction.NodePair> buildNodePairs(java.util.List<Way> ways,
boolean directed)
eliminateDuplicateNodePairs
public static java.util.List<CombineWayAction.NodePair> eliminateDuplicateNodePairs(java.util.List<CombineWayAction.NodePair> pairs)
createDirectedGraphFromNodePairs
public static CombineWayAction.NodeGraph createDirectedGraphFromNodePairs(java.util.List<CombineWayAction.NodePair> pairs)
createDirectedGraphFromWays
public static CombineWayAction.NodeGraph createDirectedGraphFromWays(java.util.Collection<Way> ways)
createUndirectedGraphFromNodeList
public static CombineWayAction.NodeGraph createUndirectedGraphFromNodeList(java.util.List<CombineWayAction.NodePair> pairs)
createUndirectedGraphFromNodeWays
public static CombineWayAction.NodeGraph createUndirectedGraphFromNodeWays(java.util.Collection<Way> ways)
rememberSuccessor
protected void rememberSuccessor(CombineWayAction.NodePair pair)
rememberPredecessors
protected void rememberPredecessors(CombineWayAction.NodePair pair)
isTerminalNode
protected boolean isTerminalNode(Node n)
prepare
protected void prepare()
add
public void add(CombineWayAction.NodePair pair)
add
public void add(java.util.List<CombineWayAction.NodePair> pairs)
getStartNode
protected Node getStartNode()
getTerminalNodes
protected java.util.Set<Node> getTerminalNodes()
getNodes
protected java.util.Set<Node> getNodes(java.util.Stack<CombineWayAction.NodePair> pairs)
getOutboundPairs
protected java.util.List<CombineWayAction.NodePair> getOutboundPairs(CombineWayAction.NodePair pair)
getOutboundPairs
protected java.util.List<CombineWayAction.NodePair> getOutboundPairs(Node node)
getNodes
protected java.util.Set<Node> getNodes()
isSpanningWay
protected boolean isSpanningWay(java.util.Stack<CombineWayAction.NodePair> way)
buildPathFromNodePairs
protected java.util.List<Node> buildPathFromNodePairs(java.util.Stack<CombineWayAction.NodePair> path)
buildSpanningPath
protected java.util.List<Node> buildSpanningPath(Node startNode)
- Tries to find a spanning path starting from node
startNode
.
Traverses the path in depth-first order.
- Parameters:
startNode
- the start node
- Returns:
- the spanning path; null, if no path is found
buildSpanningPath
public java.util.List<Node> buildSpanningPath()
- Tries to find a path through the graph which visits each edge (i.e.
the segment of a way) exactly one.
- Returns:
- the path; null, if no path was found
JOSM