Neo4j Community

org.neo4j.graphdb.traversal
Interface Traverser

All Superinterfaces:
Iterable<Path>

public interface Traverser
extends Iterable<Path>

This interface represents the traverser which is used to step through the results of a traversal. Each step can be represented in different ways. The default is as Path objects which all other representations can be derived from, i.e Node or Relationship. Each step can also be represented in one of those representations directly.


Method Summary
 Iterator<Path> iterator()
          Represents the traversal in the form of Paths.
 Iterable<Node> nodes()
          Represents the traversal in the form of Nodes.
 Iterable<Relationship> relationships()
          Represents the traversal in the form of Relationships.
 

Method Detail

nodes

Iterable<Node> nodes()
Represents the traversal in the form of Nodes. This is a convenient way to iterate over Paths and get the Path.endNode() for each position.

Returns:
the traversal in the form of Node objects.

relationships

Iterable<Relationship> relationships()
Represents the traversal in the form of Relationships. This is a convenient way to iterate over Paths and get the Path.lastRelationship() for each position.

Returns:
the traversal in the form of Relationship objects.

iterator

Iterator<Path> iterator()
Represents the traversal in the form of Paths.

Specified by:
iterator in interface Iterable<Path>
Returns:
the traversal in the form of Path objects.

Neo4j Community

Copyright © 2011 The Neo4j Graph Database Project. All Rights Reserved.