Record Class Dual

java.lang.Object
java.lang.Record
rocks.palaiologos.maja.Dual

@Desugar public record Dual(double a, double b) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Dual
     
    static final Dual
     
    static final Dual
     
    static final Dual
     
    static final Dual
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a complex value with real and dual parts.
    Dual(double re)
    Construct a complex value with the given real part and zero dual parts.
    Dual(double a, double b)
    Creates an instance of a Dual record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    a()
    Returns the value of the a record component.
    double
    b()
    Returns the value of the b record component.
    boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    static boolean
     
    static boolean
     
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • NaN

      public static final Dual NaN
    • INFINITY

      public static final Dual INFINITY
    • ZERO

      public static final Dual ZERO
    • ONE

      public static final Dual ONE
    • EPS

      public static final Dual EPS
  • Constructor Details

    • Dual

      public Dual(double re)
      Construct a complex value with the given real part and zero dual parts.
    • Dual

      public Dual()
      Construct a complex value with real and dual parts.
    • Dual

      public Dual(double a, double b)
      Creates an instance of a Dual record class.
      Parameters:
      a - the value for the a record component
      b - the value for the b record component
  • Method Details

    • isNaN

      public static boolean isNaN(Dual c)
    • isInfinite

      public static boolean isInfinite(Dual c)
    • equals

      public 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. All components in this record class 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.
    • toString

      public 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
    • a

      public double a()
      Returns the value of the a record component.
      Returns:
      the value of the a record component
    • b

      public double b()
      Returns the value of the b record component.
      Returns:
      the value of the b record component