Class Path
java.lang.Object
redis.clients.jedis.graph.entities.Path
This class represents a path in the graph.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the first node in the path.getEdge(int index) Returns an edge with specified index in the path.getEdges()Returns the edges of the path.getNode(int index) Returns a node with specified index in the path.getNodes()Returns the nodes of the path.inthashCode()lastNode()Returns the last node in the path.intlength()Returns the length of the path - number of edges.intReturn the number of nodes in the path.toString()
-
Field Details
-
nodes
-
edges
-
-
Constructor Details
-
Path
Parametrized constructor- Parameters:
nodes- - List of nodes.edges- - List of edges.
-
-
Method Details
-
getNodes
Returns the nodes of the path.- Returns:
- List of nodes.
-
getEdges
Returns the edges of the path.- Returns:
- List of edges.
-
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
Returns the first node in the path.- Returns:
- First nodes in the path.
- Throws:
IndexOutOfBoundsException- if the path is empty.
-
lastNode
Returns the last node in the path.- Returns:
- Last nodes in the path.
- Throws:
IndexOutOfBoundsException- if the path is empty.
-
getNode
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
Returns an edge with specified index in the path.- Returns:
- Edge.
- Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= length())
-
equals
-
hashCode
public int hashCode() -
toString
-