[Neo] First external committer?
Viktor Klang
viktor.klang at gmail.com
Tue Nov 20 21:23:39 CET 2007
Greetings people!
How'd you like to be able to write stuff like this?
ReturnableEvaluator returnEval = new ReturnableEvaluator(){
@Override
public boolean isReturnableNode(TraversalPosition currentPos) {
return (currentPos.currentNode().hasProperty("name"));
}
};
Traverser t = *root.traverse(by(Order.BREADTH_FIRST)
.add(MyRelTypes.DADDY, Direction.OUTGOING)
.add(MyRelTypes.MOMMY,Direction.INCOMING)
.set(StopEvaluator.END_OF_NETWORK)
.set(returnEval))*;
for(Node node : t)
doFunStuffWith(node);
Or even:
TraverseSpecification spec = *by(Order.BREADTH_FIRST)
.add(MyRelTypes.DADDY, Direction.OUTGOING)
.add(MyRelTypes.MOMMY,Direction.INCOMING)
.set(StopEvaluator.END_OF_NETWORK)
.set(returnEval);
*for(Node node : *someNode.traverse(spec)*)
doFunStuffWith(node);*
*
for(Node node : *someOtherNode.traverse(spec)*)
doFunStuffWith(node);*
*Interested?
Code is already written and I've played with it a bit.
How do you like your patches served? :)
Best regards
-Viktor*
**
*
More information about the User
mailing list