public final class Writers extends Object
final Writer<Genotype<BitGene> bgw =
Writers.Genotype.writer(Writers.BitChromosome.writer()));
final Writer<Genotype<IntegerGene>> igw =
Writers.Genotype.writer(Writers.IntegerChromosome.writer()));
final Writer<Genotype<DoubleGene>> dgw =
Writers.Genotype.writer(Writers.DoubleChromosome.writer()));
final List<Genotype<BitGene>> genotypes = ...;
try (OutputStream out = Files.newOutputStream(Paths.get("path"))) {
Writers.write(out, genotypes, Writers.BitChromosome.writer());
}
Modifier and Type | Class and Description |
---|---|
static class |
Writers.BitChromosome
This class contains static writer methods for
BitChromosome objects. |
static class |
Writers.BoundedChromosome
This class contains static writer methods for
BoundedChromosome objects. |
static class |
Writers.CharacterChromosome
This class contains static writer methods for
CharacterChromosome objects. |
static class |
Writers.DoubleChromosome
This class contains static writer methods for
DoubleChromosome objects. |
static class |
Writers.Genotype
This class contains static writer methods for
Genotype objects. |
static class |
Writers.Genotypes
This class contains static writer methods for
Genotype objects. |
static class |
Writers.IntegerChromosome
This class contains static writer methods for
IntegerChromosome objects. |
static class |
Writers.LongChromosome
This class contains static writer methods for
LongChromosome objects. |
static class |
Writers.PermutationChromosome
This class contains static writer methods for
PermutationChromosome objects. |
Modifier and Type | Method and Description |
---|---|
static <A,G extends Gene<A,G>,C extends Chromosome<G>> |
write(OutputStream out,
Collection<Genotype<G>> data,
Writer<? super C> chromosomeWriter)
Write the given
Genotype to the given output
stream. |
public static <A,G extends Gene<A,G>,C extends Chromosome<G>> void write(OutputStream out, Collection<Genotype<G>> data, Writer<? super C> chromosomeWriter) throws XMLStreamException
Genotype
to the given output
stream.A
- the allele typeG
- the gene typeC
- the chromosome typeout
- the target output streamdata
- the genotypes to writechromosomeWriter
- the chromosome writer used to write the
genotypesXMLStreamException
- if an error occurs while writing the
chromosomeNullPointerException
- if the one of the arguments is
null
Writers.Genotypes.write(OutputStream, Collection, Writer)
© 2007-2017 Franz Wilhelmstötter (2017-11-16 20:01)