public class GraphTraverserModule extends Object
| Constructor and Description |
|---|
GraphTraverserModule() |
| Modifier and Type | Method and Description |
|---|---|
SGraph |
getGraph() |
void |
setGraph(SGraph graph) |
void |
traverse(List<? extends SNode> startNodes,
SGraph.GRAPH_TRAVERSE_TYPE traverseType,
String traverseId,
GraphTraverseHandler traverseHandler,
boolean isCycleSafe)
Traverses a graph in the given order traverseType and starts traversing
with the given startNodes.
|
void |
traverse(List<SNode> startNodes,
SGraph.GRAPH_TRAVERSE_TYPE traverseType,
String traverseId,
GraphTraverseHandler traverseHandler)
Traverses a graph in the given order traverseType and starts traversing
with the given startNodes.
|
protected SGraph graph
public SGraph getGraph()
public void setGraph(SGraph graph)
public void traverse(List<SNode> startNodes, SGraph.GRAPH_TRAVERSE_TYPE traverseType, String traverseId, GraphTraverseHandler traverseHandler)
GraphTraverseHandler#checkConstraint(GRAPH_TRAVERSE_TYPE, String, SRelation, SNode, long)
of the given callback handler traverseHandler, second the method
GraphTraverseHandler#nodeReached(GRAPH_TRAVERSE_TYPE, String, SNode, SRelation, SNode, long)
is invoked. When a node was left, the method
GraphTraverseHandler#nodeLeft(GRAPH_TRAVERSE_TYPE, String, SNode, SRelation, SNode, long)
is invoked. When calling these methods, the traverseId will be passed, so
that the callback handler knows which traversal is meant. This is
helpful, in case of a single callback handler is used for more than one
traversal at the same time. This method throws a
SaltInvalidModelException in case of the graph contains a cycle.
A cycle means a path containing the same node twice. Cycle safe breadth
first traversing could consume a lot of memory because the algorithm
keeps a map of all visited Nodes for every start node.startNodes - list of nodes at which the traversal shall starttraverseType - type of traversingtraverseId - identification for callback handler, in case of more than one
traversal is running at the same time with the same callback
handlertraverseHandler - callback handler, on which the three methods will be invokedpublic void traverse(List<? extends SNode> startNodes, SGraph.GRAPH_TRAVERSE_TYPE traverseType, String traverseId, GraphTraverseHandler traverseHandler, boolean isCycleSafe)
GraphTraverseHandler#checkConstraint(GRAPH_TRAVERSE_TYPE, String, SRelation, SNode, long)
of the given callback handler traverseHandler, second the method
GraphTraverseHandler#nodeReached(GRAPH_TRAVERSE_TYPE, String, SNode, SRelation, SNode, long)
is invoked. When a node was left, the method
GraphTraverseHandler#nodeLeft(GRAPH_TRAVERSE_TYPE, String, SNode, SRelation, SNode, long)
is invoked. When calling these methods, the traverseId will be passed, so
that the callback handler knows which traversal is meant. This is
helpful, in case of a single callback handler is used for more than one
traversal at the same time. This method throws a
SaltInvalidModelException in case of the graph contains a cycle.
A cycle means a path containing the same node twice. Cycle safe breadth
first traversing could consume a lot of memory because the algorithm
keeps a map of all visited Nodes for every start node.startNodes - list of nodes at which the traversal shall starttraverseType - type of traversingtraverseId - identification for callback handler, in case of more than one
traversal is running at the same time with the same callback
handlertraverseHandler - callback handler, on which the three methods will be invokedisCycleSafe - if this value is false, this method does not take care about
cycles. This can invoke endless loops.Copyright © 2009–2015 Humboldt-Universität zu Berlin, INRIA. All rights reserved.