Package yams.units

Record Class EasyCRTConfig.CrtGearPair

java.lang.Object
java.lang.Record
yams.units.EasyCRTConfig.CrtGearPair
Record Components:
gearA - first gear tooth count
gearB - second gear tooth count
lcm - least common multiple of the two gears
coverage - coverage in mechanism rotations
gcd - greatest common divisor of the two gears
theoreticalIterations - 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

    Constructors
    Constructor
    Description
    CrtGearPair(int gearA, int gearB, int lcm, Angle coverage, int gcd, int theoreticalIterations)
    Creates an instance of a CrtGearPair record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the coverage record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    gcd()
    Returns the value of the gcd record component.
    int
    Returns the value of the gearA record component.
    int
    Returns the value of the gearB record component.
    final int
    Returns a hash code value for this object.
    int
    lcm()
    Returns the value of the lcm record component.
    int
    Returns the value of the theoreticalIterations record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • CrtGearPair

      public CrtGearPair(int gearA, int gearB, int lcm, Angle coverage, int gcd, int theoreticalIterations)
      Creates an instance of a CrtGearPair record class.
      Parameters:
      gearA - the value for the gearA record component
      gearB - the value for the gearB record component
      lcm - the value for the lcm record component
      coverage - the value for the coverage record component
      gcd - the value for the gcd record component
      theoreticalIterations - the value for the theoreticalIterations record component
  • Method Details

    • 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.
    • gearA

      public int gearA()
      Returns the value of the gearA record component.
      Returns:
      the value of the gearA record component
    • gearB

      public int gearB()
      Returns the value of the gearB record component.
      Returns:
      the value of the gearB record component
    • lcm

      public int lcm()
      Returns the value of the lcm record component.
      Returns:
      the value of the lcm record component
    • coverage

      public Angle coverage()
      Returns the value of the coverage record component.
      Returns:
      the value of the coverage record component
    • gcd

      public int gcd()
      Returns the value of the gcd record component.
      Returns:
      the value of the gcd record component
    • theoreticalIterations

      public int theoreticalIterations()
      Returns the value of the theoreticalIterations record component.
      Returns:
      the value of the theoreticalIterations record component