Package io.jenetics.xml
Class Writers.BitChromosome
- java.lang.Object
-
- io.jenetics.xml.Writers.BitChromosome
-
- Enclosing class:
- Writers
public static final class Writers.BitChromosome extends Object
This class contains static writer methods forBitChromosomeobjects.Writer code
XML outputfinal 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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidwrite(OutputStream out, BitChromosome data)Write the givenBitChromosometo the given output stream.static Writer<BitChromosome>writer()Return aWriterforBitChromosomeobjects.
-
-
-
Method Detail
-
writer
public static Writer<BitChromosome> writer()
Return aWriterforBitChromosomeobjects.- Returns:
- a chromosome writer
-
write
public static void write(OutputStream out, BitChromosome data) throws XMLStreamException
Write the givenBitChromosometo 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
-
-