Traverser (Neo4j Community 2.1.0-M01 API)
Date: 2014-02-20

org.neo4j.graphdb.traversal

## Interface Traverser

- All Superinterfaces:
    Iterable<Path>, ResourceIterable<Path>

      public interface Traverser
      extends ResourceIterable<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

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ResourceIterator<Path>` | `iterator()` Represents the traversal in the form of `Path`s.
    `TraversalMetadata` | `metadata()`
    `ResourceIterable<Node>` | `nodes()` Represents the traversal in the form of `Node`s.
    `ResourceIterable<Relationship>` | `relationships()` Represents the traversal in the form of `Relationship`s.

- - ### Method Detail

    - #### nodes

          ResourceIterable<Node> nodes()

      Represents the traversal in the form of `Node`s. This is a convenient way to iterate over `Path`s and get the `Path.endNode()` for each position.
      Returns:
        the traversal in the form of `Node` objects.

    - #### relationships

          ResourceIterable<Relationship> relationships()

      Represents the traversal in the form of `Relationship`s. This is a convenient way to iterate over `Path`s and get the `Path.lastRelationship()` for each position.
      Returns:
        the traversal in the form of `Relationship` objects.

    - #### iterator

          ResourceIterator<Path> iterator()

      Represents the traversal in the form of `Path`s. When a traversal is done and haven't been fully iterated through, it should be `closed`.
      Specified by:
        `iterator` in interface `Iterable<Path>`
      Specified by:
        `iterator` in interface `ResourceIterable<Path>`
      Returns:
        the traversal in the form of `Path` objects.

    - #### metadata

          TraversalMetadata metadata()

      Returns:
        the `TraversalMetadata` from the last traversal performed, or being performed by this traverser.

Copyright © 2002–2014 The Neo4j Graph Database Project. All rights reserved.