Package io.jenetics.xml
Class Readers.PermutationChromosome
- java.lang.Object
-
- io.jenetics.xml.Readers.PermutationChromosome
-
- Enclosing class:
- Readers
public static final class Readers.PermutationChromosome extends Object
Reader methods forPermutationChromosomeobjects.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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <A> PermutationChromosome<A>read(InputStream in, Reader<? extends A> alleleReader)Reads a newPermutationChromosomefrom the given input stream.static <A> Reader<PermutationChromosome<A>>reader(Reader<? extends A> alleleReader)Return a reader for permutation chromosomes with the given allele reader.
-
-
-
Method Detail
-
reader
public static <A> Reader<PermutationChromosome<A>> reader(Reader<? extends A> alleleReader)
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 newPermutationChromosomefrom 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
-
-