public class ExtendedPath extends Object implements Path
Constructor and Description |
---|
ExtendedPath(Path start,
Relationship lastRelationship) |
Modifier and Type | Method and Description |
---|---|
Node |
endNode()
Returns the end node of this path.
|
static Path |
extend(Path path,
Relationship withRelationship) |
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.
|
public ExtendedPath(Path start, Relationship lastRelationship)
public Node startNode()
Path
Path.nodes()
iterable.public Node endNode()
Path
Path.nodes()
iterable. If the Path.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.public Relationship lastRelationship()
Path
Relationship
in this path.lastRelationship
in interface Path
Relationship
in this path, or null
if this path contains no Relationship
s.public Iterable<Relationship> relationships()
Path
Path.length()
0 this will be an
empty Iterable
.relationships
in interface Path
public Iterable<Relationship> reverseRelationships()
Path
Path.lastRelationship()
going backwards towards the first relationship in the path.
For a path with Path.length()
0 this will be an empty Iterable
.reverseRelationships
in interface Path
public Iterable<Node> nodes()
Path
Path.startNode()
and the last node is the same as Path.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.public Iterable<Node> reverseNodes()
Path
Path.endNode()
and the last node is the
same as Path.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.reverseNodes
in interface Path
public int length()
Path
public Iterator<PropertyContainer> iterator()
Path
Node
s and Relationship
s of this
path in order. Interleaving Node
s with Relationship
s,
starting and ending with a Node
(the Path.startNode()
and
Path.endNode()
respectively).iterator
in interface Iterable<PropertyContainer>
iterator
in interface Path
Iterable.iterator()
public static Path extend(Path path, Relationship withRelationship)
Copyright © 2002-2013 The Neo4j Graph Database Project. All Rights Reserved.