java.lang.Object
io.jenetics.xml.Writers.CharacterChromosome
- Enclosing class:
Writers
This class contains static writer methods for
XML output
CharacterChromosome
objects.
Writer code
final CharacterChromosome value = CharacterChromosome.of("ASDF", CharSeq.of("A-Z"));
try (AutoCloseableXMLStreamWriter xml = XML.writer(System.out, " ")) {
Writers.CharacterChromosome.writer().write(value, xml);
}
<character-chromosome length="4">
<valid-alleles>ABCDEFGHIJKLMNOPQRSTUVWXYZ<valid-alleles>
<alleles>ASDF</alleles>
</character-chromosome>
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
write
(OutputStream out, CharacterChromosome data) Write the givenCharacterChromosome
to the given output stream.static void
write
(OutputStream out, CharacterChromosome data, String indent) Write the givenCharacterChromosome
to the given output stream.static Writer
<CharacterChromosome> writer()
Return aWriter
forCharacterChromosome
objects.
-
Method Details
-
writer
Return aWriter
forCharacterChromosome
objects.- Returns:
- a chromosome writer
-
write
public static void write(OutputStream out, CharacterChromosome data, String indent) throws XMLStreamException Write the givenCharacterChromosome
to the given output stream.- Parameters:
out
- the target output streamdata
- the chromosome to writeindent
- the XML level indentation- Throws:
XMLStreamException
- if an error occurs while writing the chromosomeNullPointerException
- if thechromosome
or output stream isnull
-
write
Write the givenCharacterChromosome
to the given output stream.- Parameters:
out
- the target output streamdata
- the chromosome to write- Throws:
XMLStreamException
- if an error occurs while writing the chromosomeNullPointerException
- if thechromosome
or output stream isnull
-