Module io.jenetics.base
Package io.jenetics
Record Class AltererResult<G extends Gene<?,G>,C extends Comparable<? super C>>
java.lang.Object
java.lang.Record
io.jenetics.AltererResult<G,C>
- Type Parameters:
G
- the gene typeC
- the result type- Record Components:
population
- the altered populationalterations
- the number of altered individuals
- All Implemented Interfaces:
Serializable
public record AltererResult<G extends Gene<?,G>,C extends Comparable<? super C>> (ISeq<Phenotype<G extends Gene<?,G>,C extends Comparable<? super C>>> population, int alterations)
extends Record
implements Serializable
Represents the result pair of a
Alterer.alter(Seq, long)
call, which
consists of the altered population and the number of altered individuals.- Since:
- 4.0
- Version:
- 7.0
- See Also:
-
Constructor Summary
ConstructorDescriptionAltererResult
(ISeq<Phenotype<G, C>> population) Create a new alter result for the given population with zero alterations.AltererResult
(ISeq<Phenotype<G, C>> population, int alterations) Create a new alter result for the given arguments. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the value of thealterations
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.Returns the value of thepopulation
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
AltererResult
Create a new alter result for the given arguments.- Parameters:
population
- the altered populationalterations
- the number of altered individuals- Throws:
NullPointerException
- if the given population isnull
IllegalArgumentException
- if the givenalterations
is negative
-
AltererResult
Create a new alter result for the given population with zero alterations.- Parameters:
population
- the altered population- Throws:
NullPointerException
- if the given population isnull
-
-
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
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 '=='. -
population
Returns the value of thepopulation
record component.- Returns:
- the value of the
population
record component
-
alterations
Returns the value of thealterations
record component.- Returns:
- the value of the
alterations
record component
-