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
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    LinearCurve(float[] xs, float[] ys)
     
    LinearCurve(float minX, float maxX, float y0, float y1, float[] xs, float[] ys)
    Creates an instance of a LinearCurve record class.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    float
    get(float x)
     
    final int
    Returns a hash code value for this object.
    float
    Returns the value of the maxX record component.
    float
    Returns the value of the minX record component.
    final String
    Returns a string representation of this record class.
    float[]
    xs()
    Returns the value of the xs record component.
    float
    y0()
    Returns the value of the y0 record component.
    float
    y1()
    Returns the value of the y1 record component.
    float[]
    ys()
    Returns the value of the ys record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a LinearCurve record class.
      Parameters:
      minX - the value for the minX record component
      maxX - the value for the maxX record component
      y0 - the value for the y0 record component
      y1 - the value for the y1 record component
      xs - the value for the xs record component
      ys - the value for the ys record component
  • Method Details

    • builder

      public static LinearCurve.Builder builder()
    • get

      public float get(float x)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • minX

      public float minX()
      Returns the value of the minX record component.
      Returns:
      the value of the minX record component
    • maxX

      public float maxX()
      Returns the value of the maxX record component.
      Returns:
      the value of the maxX record component
    • y0

      public float y0()
      Returns the value of the y0 record component.
      Returns:
      the value of the y0 record component
    • y1

      public float y1()
      Returns the value of the y1 record component.
      Returns:
      the value of the y1 record component
    • xs

      public float[] xs()
      Returns the value of the xs record component.
      Returns:
      the value of the xs record component
    • ys

      public float[] ys()
      Returns the value of the ys record component.
      Returns:
      the value of the ys record component