Record Class AllelePair<V>
java.lang.Object
java.lang.Record
forestry.api.core.genetics.alleles.AllelePair<V>
- Type Parameters:
V- The type of value held by this pair's alleles.- Record Components:
active- The active (expressed) allele for the chromosome.inactive- The inactive allele for the chromosome.
-
Constructor Summary
ConstructorsConstructorDescriptionAllelePair(Allele<V> active, Allele<V> inactive) Creates an instance of aAllelePairrecord class. -
Method Summary
Modifier and TypeMethodDescriptionactive()Returns the value of theactiverecord component.static <V> AllelePair<V> Creates an allele pair where both the active and inactive alleles are the same.static <V> AllelePair<V> A pair where the active allele is the first dominant allele and the inactive allele is the other.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.inactive()Returns the value of theinactiverecord component.inheritHaploid(net.minecraft.util.RandomSource rand) inheritOther(net.minecraft.util.RandomSource rand, AllelePair<V> other) Creates a new pair out of one allele from this pair and one from the other pair, ordered by dominance.booleanfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
both
Creates an allele pair where both the active and inactive alleles are the same. -
inheritOther
Creates a new pair out of one allele from this pair and one from the other pair, ordered by dominance. -
inheritHaploid
-
isSameAlleles
public boolean isSameAlleles()- Returns:
trueif the active allele equals the inactive allele.
-
create
A pair where the active allele is the first dominant allele and the inactive allele is the other. THIS IS DIFFERENT THAN THE CONSTRUCTOR. -
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). -
active
Returns the value of theactiverecord component.- Returns:
- the value of the
activerecord component
-
inactive
Returns the value of theinactiverecord component.- Returns:
- the value of the
inactiverecord component
-