org.neo4j.graphdb
Interface PathExpander<STATE>

All Known Implementing Classes:
OrderedByTypeExpander, StandardExpander

public interface PathExpander<STATE>

An expander of relationships. It's a flexible way of getting relationships from a Path. Given a path, which relationships should be expanded from it to traverse further.


Method Summary
 Iterable<Relationship> expand(Path path, BranchState<STATE> state)
          Returns relationships for a Path, most commonly from the Path.endNode().
 PathExpander<STATE> reverse()
          Returns a new instance with the exact expansion logic, but reversed.
 

Method Detail

expand

Iterable<Relationship> expand(Path path,
                              BranchState<STATE> state)
Returns relationships for a Path, most commonly from the Path.endNode().

Parameters:
path - the path to expand (most commonly the end node).
state - the state of this branch in the current traversal. BranchState.getState() returns the state and BranchState.setState(Object) optionally sets the state for the children of this branch. If state isn't altered the children of this path will see the state of the parent.
Returns:
the relationships to return for the path.

reverse

PathExpander<STATE> reverse()
Returns a new instance with the exact expansion logic, but reversed. TODO example

Returns:
a reversed PathExpander.


Copyright © 2002-2013 The Neo4j Graph Database Project. All Rights Reserved.