Implementing a traversal with dynamic depth

72 Views Asked by At

Is it possible to create a traversal in java using neo4j that keeps a state for the duration of the traversal?

For example, I need an Evaluator that is almost identical to toDepth(), except that the depth at the current node is based on another comparison. Say that you had a linked list with 20 items, and you wanted the 10th [valid] one, meaning that some of the items had a particular property flag excluding them from the count. So the final returned item might actually be the 12th in the Path.

The only efficient way I can think of doing this is being able to store some state variable that is accessible to each individual evaluation. Is that possible?

I understand that I could write my own custom traversing functions to do this, but it would be nice if I could build it into the Traversal Framework.

0

There are 0 best solutions below