ReturnableEvaluator returns the things you tell it to return when they are
encountered (not at the end of the traversal). The StopEvaluator tells the
traverser when to stop traversing a given branch. So if you for example
would write a StopEvaluator like:
StopEvaluator
{
public boolean isStopNode( TraversalPosition position )
{
return position.depth() >= 3;
}
}
The traverser would stop traversing branches deeper or as deep as 3, so
that all nodes at maximum depth 3 is returned. You could also look at
TraversalDescription (gotten from org.neo4j.kernel.Traversal.description())
which is a more low-level and powerful traversal API. In that you work with
paths instead of nodes and you can configure it more.
2011/11/10 Emil Dombagolla <[email protected]>
> Dear All,
>
> I am writing traverser as follows. i want to stop the returnable evaluator
> once my condition matching node found , rather evaluating until end of the
> graph.
>
> How i can ask returnable evaluator to stop the traverse and return the
> nodes.
>
> group.traverse(Order.BREADTH_FIRST,
> StopEvaluator.END_OF_GRAPH, new
> TopicHasViewPermissionEvaluator(group,user),
> RelTypes.TOPIC,Direction.OUTGOING).iterator();
>
>
> Thanks a lot
> Emil Dombagolla,
> _______________________________________________
> Neo4j mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user
>
--
Mattias Persson, [[email protected]]
Hacker, Neo Technology
www.neotechnology.com
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user