java.lang.Object
io.jenetics.xml.Readers.PermutationChromosome
- Enclosing class:
- Readers
Reader methods for
PermutationChromosome
objects.
XML format
<permutation-chromosome length="5">
<valid-alleles type="java.lang.Integer">
<allele>0</allele>
<allele>1</allele>
<allele>2</allele>
<allele>3</allele>
<allele>4</allele>
</valid-alleles>
<order>2 1 3 5 4</order>
</permutation-chromosome>
-
Method Summary
Modifier and TypeMethodDescriptionstatic <A> PermutationChromosome<A>
read
(InputStream in, Reader<? extends A> alleleReader) Reads a newPermutationChromosome
from the given input stream.static <A> Reader<PermutationChromosome<A>>
Return a reader for permutation chromosomes with the given allele reader.
-
Method Details
-
reader
Return a reader for permutation chromosomes with the given allele reader.- Type Parameters:
A
- the allele type- Parameters:
alleleReader
- the allele reader- Returns:
- a permutation chromosome reader
- Throws:
NullPointerException
- if the given allele reader isnull
-
read
public static <A> PermutationChromosome<A> read(InputStream in, Reader<? extends A> alleleReader) throws XMLStreamException Reads a newPermutationChromosome
from the given input stream.- Type Parameters:
A
- the allele type- Parameters:
in
- the data source of the chromosomealleleReader
- the allele reader- Returns:
- a new permutation chromosome
- Throws:
XMLStreamException
- if reading the chromosome failsNullPointerException
- if one of the arguments isnull
-