Package sc.fiji.snt.util
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 endpointsp1AtStart- true if path1's start node is the closest endpoint, false if endp2AtStart- 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
ConstructorsConstructorDescriptionEndpointMatch(double distance, boolean p1AtStart, boolean p2AtStart) Creates an instance of aEndpointMatchrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubledistance()Returns the value of thedistancerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanChecks if the paths are in "natural" order for merging (p1.end → p2.start).booleanReturns the value of thep1AtStartrecord component.booleanReturns the value of thep2AtStartrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EndpointMatch
public EndpointMatch(double distance, boolean p1AtStart, boolean p2AtStart) Creates an instance of aEndpointMatchrecord class.
-
-
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
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. -
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. -
equals
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 '=='. -
distance
public double distance()Returns the value of thedistancerecord component.- Returns:
- the value of the
distancerecord component
-
p1AtStart
public boolean p1AtStart()Returns the value of thep1AtStartrecord component.- Returns:
- the value of the
p1AtStartrecord component
-
p2AtStart
public boolean p2AtStart()Returns the value of thep2AtStartrecord component.- Returns:
- the value of the
p2AtStartrecord component
-