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 TypeMethodDescriptiondoublea()Returns the value of thearecord component.doubleb()Returns the value of thebrecord component.booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static booleanisInfinite(Dual c) static booleantoString()Returns a string representation of this record class.
-
Field Details
-
a
private final double aThe field for thearecord component. -
b
private final double bThe field for thebrecord component. -
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 aDualrecord class.- Parameters:
a- the value for thearecord componentb- the value for thebrecord 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 thearecord component.- Returns:
- the value of the
arecord component
-
b
public double b()Returns the value of thebrecord component.- Returns:
- the value of the
brecord component
-