Record Class ChosenOtherChromosome
java.lang.Object
java.lang.Record
net.bmahe.genetics4j.neat.combination.parentcompare.ChosenOtherChromosome
-
Field Summary
Modifier and TypeFieldDescriptionprivate final NeatChromosome
The field for thechosen
record component.private final NeatChromosome
The field for theother
record component. -
Constructor Summary
ConstructorDescriptionChosenOtherChromosome
(NeatChromosome chosen, NeatChromosome other) Creates an instance of aChosenOtherChromosome
record class. -
Method Summary
Modifier and TypeMethodDescriptionchosen()
Returns the value of thechosen
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.other()
Returns the value of theother
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
chosen
The field for thechosen
record component. -
other
The field for theother
record component.
-
-
Constructor Details
-
ChosenOtherChromosome
Creates an instance of aChosenOtherChromosome
record class.- Parameters:
chosen
- the value for thechosen
record componentother
- the value for theother
record 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. All components in this record class are compared withObjects::equals(Object,Object)
. -
chosen
Returns the value of thechosen
record component.- Returns:
- the value of the
chosen
record component
-
other
Returns the value of theother
record component.- Returns:
- the value of the
other
record component
-