Package io.jenetics.xml
Class Writers.CharacterChromosome
- java.lang.Object
-
- io.jenetics.xml.Writers.CharacterChromosome
-
- Enclosing class:
- Writers
public static final class Writers.CharacterChromosome extends Object
This class contains static writer methods forCharacterChromosome
objects.Writer code
XML outputfinal 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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
writer
public static Writer<CharacterChromosome> 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
public static void write(OutputStream out, CharacterChromosome data) throws XMLStreamException
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
-
-