Class 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 a PgxGraph.
    • 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 returns getPathLengthWithHop() as double.
        Returns:
        total cost of this path (zero if path doesn't exist). The returned value equals the sum of the edge costs
      • getSource

        public PgxVertex<ID> getSource()
        Gets the source vertex.
        Returns:
        source vertex
      • getDestination

        public PgxVertex<ID> getDestination()
        Gets the destination vertex.
        Returns:
        destination vertex
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • destroyAsync

        public PgxFuture<java.lang.Void> destroyAsync()
        Description copied from class: Destroyable
        Requests destruction of this object. After this method returns, the behavior of any method of this class becomes undefined.
        Specified by:
        destroyAsync in class Destroyable
        Returns:
        a future which will be completed once the destruction request finishes.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object