G
- the gene type.public abstract class AbstractChromosome<G extends Gene<?,G>> extends Object implements Chromosome<G>, RandomAccess, Serializable
_genes
is not
null
and the length of the genes
> 0.Modifier and Type | Field and Description |
---|---|
protected ISeq<G> |
_genes
Array of genes which forms the chromosome.
|
protected Boolean |
_valid
Indicates whether this chromosome is valid or not.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractChromosome(ISeq<? extends G> genes)
Create a new
AbstractChromosome from the given genes
array. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
G |
get(int index)
Return the value at the given
index . |
G |
getGene(int index)
Deprecated.
|
int |
hashCode() |
boolean |
isValid()
Check if this object is valid.
|
int |
length()
Return the length of this sequence.
|
ISeq<G> |
toSeq()
Deprecated.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
as, gene, getGene, newInstance
iterator, listIterator, spliterator, stream
instances, newInstance
protected final transient ISeq<G extends Gene<?,G>> _genes
protected AbstractChromosome(ISeq<? extends G> genes)
AbstractChromosome
from the given genes
array.genes
- the genes that form the chromosome.NullPointerException
- if the given gene array is null
.IllegalArgumentException
- if the length of the gene sequence is
empty.public G get(int index)
BaseSeq
index
.public int length()
BaseSeq
@Deprecated public G getGene(int index)
Chromosome
getGene
in interface Chromosome<G extends Gene<?,G>>
index
- The gene index.@Deprecated public ISeq<G> toSeq()
Chromosome
toSeq
in interface Chromosome<G extends Gene<?,G>>
public boolean isValid()
Verifiable
isValid
in interface Verifiable
© 2007-2020 Franz Wilhelmstötter (2020-02-18 20:01)