java.lang.Object
io.jenetics.xml.Writers.IntegerChromosome
- Enclosing class:
- Writers
This class contains static writer methods for
 
 XML output
 
IntegerChromosome objects.
 Writer code
final IntegerChromosome value = IntegerChromosome
    .of(Integer.MIN_VALUE, Integer.MAX_VALUE, 3);
try (AutoCloseableXMLStreamWriter xml = XML.writer(System.out, "    ")) {
    Writers.IntegerChromosome.writer().write(value, xml);
}
 
 <int-chromosome length="3">
     <min>-2147483648</min>
     <max>2147483647</max>
     <alleles>
         <allele>-1878762439</allele>
         <allele>-957346595</allele>
         <allele>-88668137</allele>
     </alleles>
 </int-chromosome>
  - 
Method SummaryModifier and TypeMethodDescriptionReturn the default integer allele writer for theIntegerChromosome.static voidwrite(OutputStream out, IntegerChromosome data) Write the givenIntegerChromosometo the given output stream.static voidwrite(OutputStream out, IntegerChromosome data, String indent) Write the givenIntegerChromosometo the given output stream.static Writer<IntegerChromosome> writer()Return aWriterforIntegerChromosomeobjects.static Writer<IntegerChromosome> Return aWriterforIntegerChromosomeobjects.
- 
Method Details- 
alleleWriterReturn the default integer allele writer for theIntegerChromosome.- Returns:
- the default integer allele writer
 
- 
writerReturn aWriterforIntegerChromosomeobjects.- Parameters:
- alleleWriter- the allele writer used for writing the integer allele. Might be useful for using different integer encodings.
- Returns:
- a chromosome writer
- Throws:
- NullPointerException- if the given- alleleWriteris- null
 
- 
writerReturn aWriterforIntegerChromosomeobjects.- Returns:
- a chromosome writer
 
- 
writepublic static void write(OutputStream out, IntegerChromosome data, String indent) throws XMLStreamException Write the givenIntegerChromosometo the given output stream.- Parameters:
- out- the target output stream
- data- the chromosome to write
- indent- the XML level indentation
- Throws:
- XMLStreamException- if an error occurs while writing the chromosome
- NullPointerException- if the- chromosomeor output stream is- null
 
- 
writeWrite the givenIntegerChromosometo the given output stream.- Parameters:
- out- the target output stream
- data- the chromosome to write
- Throws:
- XMLStreamException- if an error occurs while writing the chromosome
- NullPointerException- if the- chromosomeor output stream is- null
 
 
-