Class AbstractChromosome<G extends Gene<?,G>>
java.lang.Object
io.jenetics.AbstractChromosome<G>
- Type Parameters:
G- the gene type.
- All Implemented Interfaces:
Chromosome<G>, BaseSeq<G>, Factory<Chromosome<G>>, Verifiable, Iterable<G>, RandomAccess
- Direct Known Subclasses:
AbstractTreeChromosome, AnyChromosome, BigIntegerChromosome, CharacterChromosome, DoubleChromosome, IntegerChromosome, LongChromosome, PermutationChromosome
public abstract class AbstractChromosome<G extends Gene<?,G>>
extends Object
implements Chromosome<G>
The abstract base implementation of the Chromosome interface. The implementors
of this class must assure that the protected member
_genes is not
null and the length of the genes > 0.- Since:
- 1.0
- Version:
- 5.2
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractChromosome(ISeq<? extends G> genes) Create a newAbstractChromosomefrom the givengenesarray. -
Method Summary
Methods inherited from interface BaseSeq
forEach, isEmpty, iterator, listIterator, nonEmpty, spliterator, streamMethods inherited from interface Chromosome
as, gene, newInstanceMethods inherited from interface Factory
instances, newInstance
-
Field Details
-
_genes
-
_valid
-
-
Constructor Details
-
AbstractChromosome
Create a newAbstractChromosomefrom the givengenesarray.- Parameters:
genes- the genes that form the chromosome.- Throws:
NullPointerException- if the given gene array isnull.IllegalArgumentException- if the length of the gene sequence is empty.
-
-
Method Details
-
get
-
length
-
isValid
Description copied from interface:VerifiableCheck if this object is valid.- Specified by:
isValidin interfaceChromosome<G extends Gene<?,G>> - Specified by:
isValidin interfaceVerifiable- Returns:
- true if this object is valid, false otherwise.
-
hashCode
-
equals
-
toString
-