Package net.commoble.exmachina.api

# Record Class MechanicalConnection

java.lang.Object
java.lang.Record
net.commoble.exmachina.api.MechanicalConnection

Record Components:
  `parity` - Parity transformation of the connection. If POSITIVE, no parity transformation. If NEGATIVE, the connection inverts parity, causing the nodes to rotate in opposite directions relative to their axes. If ZERO, the existing of connection zeroes the mechanical graph, causing no nodes to rotate. Mutual connections must have the same parity or will else zero themselves.
  `teeth` - How many "gear teeth" the node forming the outgoing connection has. If both nodes of a mutual connection specify teeth > 0, a gearshift occurs, causing the node with fewer teeth to rotate faster with a speed ratio equal to the teeth ratio. If either half of the connection specify non-positive teeth, no gearshift occurs.

public record MechanicalConnection(Parity parity, int teeth) extends Record
Represents properties of some connection from one mechanical node to another.

## Constructor Summary

Constructors
Constructor
Description
`MechanicalConnection(Parity parity, int teeth)`
Creates an instance of a `MechanicalConnection` record class.

## Method Summary

Modifier and Type
Method
Description
`final boolean`
`equals(Object o)`
Indicates whether some other object is "equal to" this one.
`final int`
`hashCode()`
Returns a hash code value for this object.
`Parity`
`parity()`
Returns the value of the `parity` record component.
`int`
`teeth()`
Returns the value of the `teeth` record component.
`final String`
`toString()`
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

### MechanicalConnection

public MechanicalConnection(Parity parity, int teeth)
Creates an instance of a `MechanicalConnection` record class.

Parameters:
  `parity` - the value for the `parity` record component
  `teeth` - the value for the `teeth` 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.

### parity

public Parity parity()
Returns the value of the `parity` record component.

Returns:
  the value of the `parity` record component

### teeth

public int teeth()
Returns the value of the `teeth` record component.

Returns:
  the value of the `teeth` record component