Class Path
- java.lang.Object
-
- com.redislabs.redisgraph.graph_entities.Path
-
public final class Path extends Object
This class represents a path in the graph.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)NodefirstNode()Returns the first node in the path.EdgegetEdge(int index)Returns an edge with specified index in the path.List<Edge>getEdges()Returns the edges of the path.NodegetNode(int index)Returns a node with specified index in the path.List<Node>getNodes()Returns the nodes of the path.inthashCode()NodelastNode()Returns the last node in the path.intlength()Returns the length of the path - number of edges.intnodeCount()Return the number of nodes in the path.StringtoString()
-
-
-
Method Detail
-
length
public int length()
Returns the length of the path - number of edges.- Returns:
- Number of edges.
-
nodeCount
public int nodeCount()
Return the number of nodes in the path.- Returns:
- Number of nodes.
-
firstNode
public Node firstNode()
Returns the first node in the path.- Returns:
- First nodes in the path.
- Throws:
IndexOutOfBoundsException- if the path is empty.
-
lastNode
public Node lastNode()
Returns the last node in the path.- Returns:
- Last nodes in the path.
- Throws:
IndexOutOfBoundsException- if the path is empty.
-
getNode
public Node getNode(int index)
Returns a node with specified index in the path.- Returns:
- Node.
- Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= nodesCount())
-
getEdge
public Edge getEdge(int index)
Returns an edge with specified index in the path.- Returns:
- Edge.
- Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= length())
-
-