Package app.media
Record Class PenStroke.Segment
java.lang.Object
java.lang.Record
app.media.PenStroke.Segment
- All Implemented Interfaces:
Serializable
- Enclosing class:
- PenStroke
public static record PenStroke.Segment(double endX, double endY)
extends Record
implements Serializable
Data for a single line segment in a stroke.
- See Also:
-
Constructor Summary
ConstructorDescriptionSegment
(double endX, double endY) Creates an instance of aSegment
record class. -
Method Summary
Modifier and TypeMethodDescriptiondouble
endX()
Returns the value of theendX
record component.double
endY()
Returns the value of theendY
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Segment
public Segment(double endX, double endY) Creates an instance of aSegment
record class.- Parameters:
endX
- the value for theendX
record componentendY
- the value for theendY
record 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. -
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 '=='. -
endX
public double endX()Returns the value of theendX
record component.- Returns:
- the value of the
endX
record component
-
endY
public double endY()Returns the value of theendY
record component.- Returns:
- the value of the
endY
record component
-