Package yams.units
Record Class EasyCRTConfig.CrtGearPair
java.lang.Object
java.lang.Record
yams.units.EasyCRTConfig.CrtGearPair
- Record Components:
gearA- first gear tooth countgearB- second gear tooth countlcm- least common multiple of the two gearscoverage- coverage in mechanism rotationsgcd- greatest common divisor of the two gearstheoreticalIterations- predicted iterations required
- Enclosing class:
- EasyCRTConfig
public static record EasyCRTConfig.CrtGearPair(int gearA, int gearB, int lcm, Angle coverage, int gcd, int theoreticalIterations)
extends Record
Represents a candidate CRT gear pair.
-
Constructor Summary
ConstructorsConstructorDescriptionCrtGearPair(int gearA, int gearB, int lcm, Angle coverage, int gcd, int theoreticalIterations) Creates an instance of aCrtGearPairrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncoverage()Returns the value of thecoveragerecord component.final booleanIndicates whether some other object is "equal to" this one.intgcd()Returns the value of thegcdrecord component.intgearA()Returns the value of thegearArecord component.intgearB()Returns the value of thegearBrecord component.final inthashCode()Returns a hash code value for this object.intlcm()Returns the value of thelcmrecord component.intReturns the value of thetheoreticalIterationsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CrtGearPair
public CrtGearPair(int gearA, int gearB, int lcm, Angle coverage, int gcd, int theoreticalIterations) Creates an instance of aCrtGearPairrecord class.- Parameters:
gearA- the value for thegearArecord componentgearB- the value for thegearBrecord componentlcm- the value for thelcmrecord componentcoverage- the value for thecoveragerecord componentgcd- the value for thegcdrecord componenttheoreticalIterations- the value for thetheoreticalIterationsrecord component
-
-
Method Details
-
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 '=='. -
gearA
public int gearA()Returns the value of thegearArecord component.- Returns:
- the value of the
gearArecord component
-
gearB
public int gearB()Returns the value of thegearBrecord component.- Returns:
- the value of the
gearBrecord component
-
lcm
public int lcm()Returns the value of thelcmrecord component.- Returns:
- the value of the
lcmrecord component
-
coverage
Returns the value of thecoveragerecord component.- Returns:
- the value of the
coveragerecord component
-
gcd
public int gcd()Returns the value of thegcdrecord component.- Returns:
- the value of the
gcdrecord component
-
theoreticalIterations
public int theoreticalIterations()Returns the value of thetheoreticalIterationsrecord component.- Returns:
- the value of the
theoreticalIterationsrecord component
-