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 voidwrite(OutputStream out, CharacterChromosome data) Write the givenCharacterChromosometo the given output stream.static voidwrite(OutputStream out, CharacterChromosome data, String indent) Write the givenCharacterChromosometo the given output stream.static Writer<CharacterChromosome> writer()Return aWriterforCharacterChromosomeobjects.
-
Method Details
-
writer
Return aWriterforCharacterChromosomeobjects.- Returns:
- a chromosome writer
-
write
public static void write(OutputStream out, CharacterChromosome data, String indent) throws XMLStreamException Write the givenCharacterChromosometo 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 thechromosomeor output stream isnull
-
write
Write the givenCharacterChromosometo 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 thechromosomeor output stream isnull
-