Package com.lightning.northstar.util
Record Class LinearCurve
java.lang.Object
java.lang.Record
com.lightning.northstar.util.LinearCurve
public record LinearCurve(float minX, float maxX, float y0, float y1, float[] xs, float[] ys)
extends Record
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionLinearCurve(float[] xs, float[] ys) LinearCurve(float minX, float maxX, float y0, float y1, float[] xs, float[] ys) Creates an instance of aLinearCurverecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic LinearCurve.Builderbuilder()final booleanIndicates whether some other object is "equal to" this one.floatget(float x) final inthashCode()Returns a hash code value for this object.floatmaxX()Returns the value of themaxXrecord component.floatminX()Returns the value of theminXrecord component.final StringtoString()Returns a string representation of this record class.float[]xs()Returns the value of thexsrecord component.floaty0()Returns the value of they0record component.floaty1()Returns the value of they1record component.float[]ys()Returns the value of theysrecord component.
-
Constructor Details
-
LinearCurve
public LinearCurve(float[] xs, float[] ys) -
LinearCurve
public LinearCurve(float minX, float maxX, float y0, float y1, float[] xs, float[] ys) Creates an instance of aLinearCurverecord class.- Parameters:
minX- the value for theminXrecord componentmaxX- the value for themaxXrecord componenty0- the value for they0record componenty1- the value for they1record componentxs- the value for thexsrecord componentys- the value for theysrecord component
-
-
Method Details
-
builder
-
get
public float get(float x) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
minX
public float minX()Returns the value of theminXrecord component.- Returns:
- the value of the
minXrecord component
-
maxX
public float maxX()Returns the value of themaxXrecord component.- Returns:
- the value of the
maxXrecord component
-
y0
public float y0()Returns the value of they0record component.- Returns:
- the value of the
y0record component
-
y1
public float y1()Returns the value of they1record component.- Returns:
- the value of the
y1record component
-
xs
public float[] xs()Returns the value of thexsrecord component.- Returns:
- the value of the
xsrecord component
-
ys
public float[] ys()Returns the value of theysrecord component.- Returns:
- the value of the
ysrecord component
-