Record Class TreeUtils.EndpointMatch

java.lang.Object
java.lang.Record
sc.fiji.snt.util.TreeUtils.EndpointMatch
Record Components:
distance - the Euclidean distance between the closest endpoints
p1AtStart - true if path1's start node is the closest endpoint, false if end
p2AtStart - true if path2's start node is the closest endpoint, false if end
Enclosing class:
TreeUtils

public static record TreeUtils.EndpointMatch(double distance, boolean p1AtStart, boolean p2AtStart) extends Record
Result of finding the closest endpoints between two paths.
  • Constructor Summary

    Constructors
    Constructor
    Description
    EndpointMatch(double distance, boolean p1AtStart, boolean p2AtStart)
    Creates an instance of a EndpointMatch record class.
  • Method Summary

    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.
    boolean
    Checks if the paths are in "natural" order for merging (p1.end → p2.start).
    boolean
    Returns the value of the p1AtStart record component.
    boolean
    Returns the value of the p2AtStart record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • EndpointMatch

      public EndpointMatch(double distance, boolean p1AtStart, boolean p2AtStart)
      Creates an instance of a EndpointMatch record class.
      Parameters:
      distance - the value for the distance record component
      p1AtStart - the value for the p1AtStart record component
      p2AtStart - the value for the p2AtStart record component
  • Method Details

    • isNaturalOrder

      public boolean isNaturalOrder()
      Checks if the paths are in "natural" order for merging (p1.end → p2.start).
      Returns:
      true if no reversal is needed for either path
    • toString

      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

      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

      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. All components in this record class 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

      public double distance()
      Returns the value of the distance record component.
      Returns:
      the value of the distance record component
    • p1AtStart

      public boolean p1AtStart()
      Returns the value of the p1AtStart record component.
      Returns:
      the value of the p1AtStart record component
    • p2AtStart

      public boolean p2AtStart()
      Returns the value of the p2AtStart record component.
      Returns:
      the value of the p2AtStart record component