public interface Path extends Iterable<PropertyContainer>, Resource
Relationship
and Node
objects. The shortest path
is of length 0. Such a path contains only one node and no relationships.
During a traversal Path
instances are emitted where the current
position of the traverser is represented by each such path. The current
node in such a traversal is reached via endNode()
.Modifier and Type  Method and Description 

default void 
close() 
Node 
endNode()
Returns the end node of this path.

Iterator<PropertyContainer> 
iterator()
Iterates through both the
Node s and Relationship s of this
path in order. 
Relationship 
lastRelationship()
Returns the last
Relationship in this path. 
int 
length()
Returns the length of this path.

Iterable<Node> 
nodes()
Returns all the nodes in this path starting from the start node going
forward towards the end node.

Iterable<Relationship> 
relationships()
Returns all the relationships in between the nodes which this path
consists of.

Iterable<Node> 
reverseNodes()
Returns all the nodes in this path in reversed order, i.e.

Iterable<Relationship> 
reverseRelationships()
Returns all the relationships in between the nodes which this path
consists of in reverse order, i.e.

Node 
startNode()
Returns the start node of this path.

String 
toString()
Returns a natural string representation of this path.

forEach, spliterator
Node startNode()
nodes()
iterable.Node endNode()
nodes()
iterable. If the length()
of this path
is 0 the end node returned by this method is the same as the start node.
If a path is emitted from a traverser the end node is the current node
where the traverser is at the moment.Relationship lastRelationship()
Relationship
in this path.Relationship
in this path, or null
if this path contains no Relationship
s.Iterable<Relationship> relationships()
length()
0 this will be an
empty Iterable
.Iterable<Relationship> reverseRelationships()
lastRelationship()
going backwards towards the first relationship in the path.
For a path with length()
0 this will be an empty Iterable
.Iterable<Node> nodes()
startNode()
and the last node is the same as endNode()
.
In between those nodes there can be an arbitrary number of nodes. The
shortest path possible is just one node, where also the the start node is
the same as the end node.Iterable<Node> reverseNodes()
endNode()
and the last node is the
same as startNode()
. In between those nodes there can be an arbitrary
number of nodes. The shortest path possible is just one node, where also the
the start node is the same as the end node.int length()
String toString()
Iterator<PropertyContainer> iterator()
Node
s and Relationship
s of this
path in order. Interleaving Node
s with Relationship
s,
starting and ending with a Node
(the startNode()
and
endNode()
respectively).iterator
in interface Iterable<PropertyContainer>
Iterable.iterator()
default void close()
close
in interface AutoCloseable
close
in interface Resource
Copyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.