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 forCharacterChromosomeobjects.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 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 Detail
-
writer
public static Writer<CharacterChromosome> 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
public static void write(OutputStream out, CharacterChromosome data) throws XMLStreamException
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
-
-