|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Traverser
A traversal in the node space. A Traverser is an Iterable that
encapsulates a number of traversal parameters (defined at traverser creation)
and returns a list of nodes that match those parameters. It is created by
invoking Node.traverse(...). Upon creation, the
traverser is positioned at the start node, but it doesn't actually start
traversing until its iterator().next() method is invoked.
Typically it's used in a for-each loop as follows:
Traverser friends = node.traverse( Order.BREADTH_FIRST,
StopEvaluator.END_OF_NETWORK, ReturnableEvaluator.ALL_BUT_START_NODE,
MyRelationshipTypes.KNOWS, Direction.OUTGOING );
for ( Node friend : friends )
{
// ...
}
Node.traverse(org.neo4j.api.core.Traverser.Order, org.neo4j.api.core.StopEvaluator, org.neo4j.api.core.ReturnableEvaluator, org.neo4j.api.core.RelationshipType, org.neo4j.api.core.Direction)| Nested Class Summary | |
|---|---|
static class |
Traverser.Order
Defines a traversal order as used by the traversal framework. |
| Method Summary | |
|---|---|
TraversalPosition |
currentPosition()
Returns the current traversal postion. |
Collection<Node> |
getAllNodes()
Returns a collection of all nodes returned by this traverser. |
Iterator<Node> |
iterator()
Returns an iterator for this traverser. |
| Method Detail |
|---|
TraversalPosition currentPosition()
Collection<Node> getAllNodes()
Iterator<Node> iterator()
iterator in interface Iterable<Node>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||