Package rocks.palaiologos.maja
Record Class Dual
java.lang.Object
java.lang.Record
rocks.palaiologos.maja.Dual
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
a()
Returns the value of thea
record component.double
b()
Returns the value of theb
record component.boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static boolean
isInfinite
(Dual c) static boolean
toString()
Returns a string representation of this record class.
-
Field Details
-
NaN
-
INFINITY
-
ZERO
-
ONE
-
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 aDual
record class.- Parameters:
a
- the value for thea
record componentb
- the value for theb
record component
-
-
Method Details
-
isNaN
-
isInfinite
-
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 '=='. -
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. -
a
public double a()Returns the value of thea
record component.- Returns:
- the value of the
a
record component
-
b
public double b()Returns the value of theb
record component.- Returns:
- the value of the
b
record component
-