Package io.jenetics
Class MutatorResult<T>
- java.lang.Object
-
- io.jenetics.MutatorResult<T>
-
- All Implemented Interfaces:
Serializable
public final class MutatorResult<T> extends Object implements Serializable
Represents the result pair of one of the fourMutator.mutate
calls.- Since:
- 4.0
- Version:
- 6.0
- See Also:
Mutator.mutate(Phenotype, long, double, Random)
,Mutator.mutate(Genotype, double, Random)
,Mutator.mutate(Chromosome, double, Random)
,Mutator.mutate(Gene, Random)
, Serialized Form- Implementation Requirements:
- This class is immutable and thread-safe.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
hashCode()
int
mutations()
Return the number of mutations for this mutation result.static <T> MutatorResult<T>
of(T result)
Create a new mutation result with the given result.static <T> MutatorResult<T>
of(T result, int mutations)
Create a new mutation result with the given values.T
result()
Return the mutation result.String
toString()
-
-
-
Method Detail
-
mutations
public int mutations()
Return the number of mutations for this mutation result.- Returns:
- the number of mutations
-
of
public static <T> MutatorResult<T> of(T result, int mutations)
Create a new mutation result with the given values.- Type Parameters:
T
- the mutation result type- Parameters:
result
- the mutation resultmutations
- the number of mutations- Returns:
- a new mutation result
- Throws:
IllegalArgumentException
- if the givenmutations
is negativeNullPointerException
- if the given mutation result isnull
-
of
public static <T> MutatorResult<T> of(T result)
Create a new mutation result with the given result. The number of mutations is set to zero.- Type Parameters:
T
- the mutation result type- Parameters:
result
- the mutation result- Returns:
- a new mutation result
- Throws:
NullPointerException
- if the given mutation result isnull
-
-