|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.ggtools.grand.graph.GraphCrawler
public class GraphCrawler
Walks a graph starting from a specific node to find all the nodes accessible from it.
| Constructor Summary | |
|---|---|
GraphCrawler(Graph graph,
LinkFinder finder)
Creates a new crawler. |
|
| Method Summary | |
|---|---|
java.util.Collection |
crawl(Node startNode)
Walks the graph from startNode and returns the traversed
nodes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GraphCrawler(Graph graph,
LinkFinder finder)
graph - graph to inspectfinder - finder to use.| Method Detail |
|---|
public java.util.Collection crawl(Node startNode)
startNode and returns the traversed
nodes.
The method maintain a list of nodes to visit initialized with
startNode and a LinkedHashSet of results.
The startNode is popped from the list, added to the result set,
and the finder is used to findout all the accessible nodes from it.
The nodes founds are added to the list of nodes to visit.
This continue until there is no node to visit.
startNode - node to start the crawl from.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||