Package graph

Record Class Pathfinding.PathEnd<E extends Edge<?>>

java.lang.Object
java.lang.Record
graph.Pathfinding.PathEnd<E>
Enclosing class:
Pathfinding

static record Pathfinding.PathEnd<E extends Edge<?>>(double distance, E extends Edge<?> lastEdge) extends Record
Represents a path ending at `lastEdge.end()` along with its total weight (distance).
  • Field Summary Link icon

    Fields
    Modifier and Type
    Field
    Description
    private final double
    The field for the distance record component.
    private final E
    The field for the lastEdge record component.
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    PathEnd(double distance, E lastEdge)
    Creates an instance of a PathEnd record class.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    double
    Returns the value of the distance record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the lastEdge record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object Link icon

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details Link icon

    • distance Link icon

      private final double distance
      The field for the distance record component.
    • lastEdge Link icon

      private final E extends Edge<?> lastEdge
      The field for the lastEdge record component.
  • Constructor Details Link icon

    • PathEnd Link icon

      PathEnd(double distance, E lastEdge)
      Creates an instance of a PathEnd record class.
      Parameters:
      distance - the value for the distance record component
      lastEdge - the value for the lastEdge record component
  • Method Details Link icon

    • toString Link icon

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode Link icon

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals Link icon

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • distance Link icon

      public double distance()
      Returns the value of the distance record component.
      Returns:
      the value of the distance record component
    • lastEdge Link icon

      public E lastEdge()
      Returns the value of the lastEdge record component.
      Returns:
      the value of the lastEdge record component