java.lang.Object
io.jenetics.xml.Writers.BitChromosome
- Enclosing class:
Writers
This class contains static writer methods for
XML output
BitChromosome
objects.
Writer code
final BitChromosome value = BitChromosome.of(20, 0.5);
try (AutoCloseableXMLStreamWriter xml = XML.writer(System.out, " ")) {
Writers.BitChromosome.writer().write(value, xml);
}
<bit-chromosome length="20" ones-probability="0.5">11100011101011001010</bit-chromosome>
- Since:
- 3.9
- Version:
- 3.9
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
write
(OutputStream out, BitChromosome data) Write the givenBitChromosome
to the given output stream.static Writer
<BitChromosome> writer()
Return aWriter
forBitChromosome
objects.
-
Method Details
-
writer
Return aWriter
forBitChromosome
objects.- Returns:
- a chromosome writer
-
write
Write the givenBitChromosome
to the given output stream.- Parameters:
out
- the target output streamdata
- the bit-chromosome to write- Throws:
XMLStreamException
- if an error occurs while writing the chromosomeNullPointerException
- if one of the given arguments isnull
-