java.lang.Object
java.lang.Record
org.jhotdraw8.geom.PointAndDerivative
-
Constructor Summary
ConstructorsConstructorDescriptionPointAndDerivative(double x, double y, double dx, double dy) Creates an instance of aPointAndDerivativerecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubledx()Returns the value of thedxrecord component.doubledy()Returns the value of thedyrecord component.final booleanIndicates whether some other object is "equal to" this one.doublegetAngle()Returns the angle of the point in radians.<T> TgetDerivative(BiFunction<Double, Double, T> factory) <T> TgetPoint(BiFunction<Double, Double, T> factory) final inthashCode()Returns a hash code value for this object.reverse()Returns a new point with reversed derivative.final StringtoString()Returns a string representation of this record class.doublex()Returns the value of thexrecord component.doubley()Returns the value of theyrecord component.
-
Constructor Details
-
PointAndDerivative
public PointAndDerivative(double x, double y, double dx, double dy) Creates an instance of aPointAndDerivativerecord class.- Parameters:
x- the value for thexrecord componenty- the value for theyrecord componentdx- the value for thedxrecord componentdy- the value for thedyrecord component
-
-
Method Details
-
getPoint
-
getDerivative
-
getAngle
public double getAngle()Returns the angle of the point in radians.- Returns:
- angle in radians
-
reverse
Returns a new point with reversed derivative. -
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 '=='. -
x
public double x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public double y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
dx
public double dx()Returns the value of thedxrecord component.- Returns:
- the value of the
dxrecord component
-
dy
public double dy()Returns the value of thedyrecord component.- Returns:
- the value of the
dyrecord component
-