public class GraphUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
GraphUtils.BreadthFirstNodeInserter<N>
node inserter for breadth first search
|
protected static class |
GraphUtils.DefaultGraphIterator<E,ID> |
protected static class |
GraphUtils.DepthFirstNodeInserter<N>
Node inserter for depth-first-search
|
protected static interface |
GraphUtils.NodeInserter<N>
Interface to abstract the type of search (breadth-first / depth-first)
|
protected static class |
GraphUtils.PredicateMatcher<N> |
| Modifier and Type | Method and Description |
|---|---|
static <N,ID> GraphIterator<N> |
iterateBreadthFirst(Collection<N> fromNodes,
com.google.common.base.Function<N,Collection<N>> nextNodeProvider,
com.google.common.base.Function<N,ID> nodeIdExtractor)
Iterates a graph in breadth-first order.
|
static <N,ID> GraphIterator<N> |
iterateDepthFirst(Collection<N> fromNodes,
com.google.common.base.Function<N,Collection<N>> nextNodeProvider,
com.google.common.base.Function<N,ID> nodeIdExtractor)
Iterates a graph in depth-first order.
|
public static <N,ID> GraphIterator<N> iterateDepthFirst(Collection<N> fromNodes, com.google.common.base.Function<N,Collection<N>> nextNodeProvider, com.google.common.base.Function<N,ID> nodeIdExtractor)
N - fromNodes - the nodes to start the iteration fromnextNodeProvider - a function that provides the next nodes for a nodenodeIdExtractor - a function that returns the id of a node, used for detecting nodes that have already been traversedGraphIterator that can be used to traverse the graphpublic static <N,ID> GraphIterator<N> iterateBreadthFirst(Collection<N> fromNodes, com.google.common.base.Function<N,Collection<N>> nextNodeProvider, com.google.common.base.Function<N,ID> nodeIdExtractor)
N - fromNodes - the nodes to start the iteration fromnextNodeProvider - a function that provides the next nodes for a nodenodeIdExtractor - a function that returns the id of a node, used for detecting nodes that have already been traversedGraphIterator that can be used to traverse the graphCopyright © 2015 Atlassian Software Systems. All rights reserved.