G - the gene type.public abstract class AbstractChromosome<G extends Gene<?,G>> extends Object implements Chromosome<G>, RandomAccess
_genes is not
 null and the length of the genes > 0.| Modifier and Type | Field and Description | 
|---|---|
| protected ISeq<G> | _genesArray of genes which forms the chromosome. | 
| protected Boolean | _validIndicates whether this chromosome is valid or not. | 
| Modifier | Constructor and Description | 
|---|---|
| protected  | AbstractChromosome(ISeq<? extends G> genes)Create a new  AbstractChromosomefrom the givengenesarray. | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | equals(Object obj) | 
| G | getGene(int index)Return the gene on the specified index. | 
| int | hashCode() | 
| boolean | isValid()Check if this object is valid. | 
| Iterator<G> | iterator() | 
| int | length()Returns the length of the Chromosome. | 
| ISeq<G> | toSeq()Return an unmodifiable sequence of the genes of this chromosome. | 
| String | toString() | 
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetGene, newInstanceforEach, spliteratorinstances, newInstanceprotected transient ISeq<G extends Gene<?,G>> _genes
protected AbstractChromosome(ISeq<? extends G> genes)
AbstractChromosome from the given genes
 array. The genes array is not copied, but sealed, so changes to the given
 genes array doesn't effect the genes of this chromosome.genes - the genes that form the chromosome.NullPointerException - if the given gene array is null.IllegalArgumentException - if the length of the gene array is
          smaller than one.public G getGene(int index)
ChromosomegetGene in interface Chromosome<G extends Gene<?,G>>index - The gene index.public ISeq<G> toSeq()
ChromosometoSeq in interface Chromosome<G extends Gene<?,G>>public boolean isValid()
VerifiableisValid in interface Verifiablepublic int length()
Chromosomelength in interface Chromosome<G extends Gene<?,G>>© 2007-2014 Franz Wilhelmstötter (2014-12-28 10:45)