Package oracle.pgx.api
Class PgxPath<ID>
- java.lang.Object
-
- oracle.pgx.api.internal.ApiObject
-
- oracle.pgx.api.Destroyable
-
- oracle.pgx.api.PgxPath<ID>
-
- Type Parameters:
ID- the vertex ID type
- All Implemented Interfaces:
java.lang.AutoCloseable
public class PgxPath<ID> extends Destroyable
A path from a source to a destination vertex in aPgxGraph.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfacePgxPath.PathIterable<E>static classPgxPath.PathIterator<E>A read-onlyListIteratorwith an additionalPgxPath.PathIterator.reset()method to start over iteration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PgxFuture<java.lang.Void>destroyAsync()Requests destruction of this object.booleanequals(java.lang.Object obj)booleanexists()Checks whether a path exists.PgxVertex<ID>getDestination()Gets the destination vertex.PgxPath.PathIterable<PgxEdge>getEdges()Gets the edges of this path.PgxGraphgetGraph()Gets the PgxGraph the Path is defined on.doublegetPathLengthWithCost()Gets the path cost Note: for hop-based algorithms, this method returnsgetPathLengthWithHop()as double.longgetPathLengthWithHop()Gets the path length in hops.PgxVertex<ID>getSource()Gets the source vertex.PgxPath.PathIterable<PgxVertex<ID>>getVertices()Gets the vertices of this path.inthashCode()java.lang.StringtoString()-
Methods inherited from class oracle.pgx.api.Destroyable
close, destroy
-
-
-
-
Method Detail
-
getGraph
public PgxGraph getGraph()
Gets the PgxGraph the Path is defined on.- Returns:
- the graph
-
exists
public boolean exists()
Checks whether a path exists.- Returns:
- true, if exists
-
getPathLengthWithHop
public long getPathLengthWithHop()
Gets the path length in hops.- Returns:
- number of edges in this path (zero if path doesn't exist)
-
getPathLengthWithCost
public double getPathLengthWithCost()
Gets the path cost Note: for hop-based algorithms, this method returnsgetPathLengthWithHop()as double.- Returns:
- total cost of this path (zero if path doesn't exist). The returned value equals the sum of the edge costs
-
getDestination
public PgxVertex<ID> getDestination()
Gets the destination vertex.- Returns:
- destination vertex
-
getVertices
public PgxPath.PathIterable<PgxVertex<ID>> getVertices()
Gets the vertices of this path.- Returns:
- vertices iterable
-
getEdges
public PgxPath.PathIterable<PgxEdge> getEdges()
Gets the edges of this path.- Returns:
- edges iterable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
destroyAsync
public PgxFuture<java.lang.Void> destroyAsync()
Description copied from class:DestroyableRequests destruction of this object. After this method returns, the behavior of any method of this class becomes undefined.- Specified by:
destroyAsyncin classDestroyable- Returns:
- a future which will be completed once the destruction request finishes.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-