Class Writers.IntegerChromosome

java.lang.Object
io.jenetics.xml.Writers.IntegerChromosome
Enclosing class:
Writers

public static final class Writers.IntegerChromosome extends Object
This class contains static writer methods for 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);
}
XML output
 
 <int-chromosome length="3">
     <min>-2147483648</min>
     <max>2147483647</max>
     <alleles>
         <allele>-1878762439</allele>
         <allele>-957346595</allele>
         <allele>-88668137</allele>
     </alleles>
 </int-chromosome>