Record Class PotentialOverlap
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.client.screens.research.graph.lines.PotentialOverlap
- Record Components:
length- The length of the overlap, or 1 for point intersectionspoint- The intersection/middle pointseg1- First segment involvedseg2- Second segment involvedisOverlap- True if segments overlap, false if they just intersectisSegment- True if the overlap is a segment (horizontal or vertical), false if it's just a point intersection
public record PotentialOverlap(int length, Point point, LineSegment seg1, LineSegment seg2, boolean isOverlap, boolean isSegment)
extends Record
Represents a potential overlap/intersection between line segments. May be empty.
-
Constructor Summary
ConstructorsConstructorDescriptionPotentialOverlap(int length, Point point, LineSegment seg1, LineSegment seg2, boolean isOverlap, boolean isSegment) Creates an instance of aPotentialOverlaprecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisOverlaprecord component.booleanReturns the value of theisSegmentrecord component.intlength()Returns the value of thelengthrecord component.static PotentialOverlapof(LineSegment seg1, LineSegment seg2) point()Returns the value of thepointrecord component.seg1()Returns the value of theseg1record component.seg2()Returns the value of theseg2record component.@NotNull StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PotentialOverlap
public PotentialOverlap(int length, Point point, LineSegment seg1, LineSegment seg2, boolean isOverlap, boolean isSegment) Creates an instance of aPotentialOverlaprecord class.- Parameters:
length- the value for thelengthrecord componentpoint- the value for thepointrecord componentseg1- the value for theseg1record componentseg2- the value for theseg2record componentisOverlap- the value for theisOverlaprecord componentisSegment- the value for theisSegmentrecord component
-
-
Method Details
-
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. -
of
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
length
public int length()Returns the value of thelengthrecord component.- Returns:
- the value of the
lengthrecord component
-
point
Returns the value of thepointrecord component.- Returns:
- the value of the
pointrecord component
-
seg1
Returns the value of theseg1record component.- Returns:
- the value of the
seg1record component
-
seg2
Returns the value of theseg2record component.- Returns:
- the value of the
seg2record component
-
isOverlap
public boolean isOverlap()Returns the value of theisOverlaprecord component.- Returns:
- the value of the
isOverlaprecord component
-
isSegment
public boolean isSegment()Returns the value of theisSegmentrecord component.- Returns:
- the value of the
isSegmentrecord component
-