public static final class Writers.DoubleChromosome extends Object
DoubleChromosome objects.
Writer code
final DoubleChromosome value = DoubleChromosome.of(0.0, 1.0, 3);
try (AutoCloseableXMLStreamWriter xml = XML.writer(System.out, " ")) {
Writers.DoubleChromosome.writer().write(value, xml);
}
<double-chromosome length="3">
<min>0.0</min>
<max>1.0</max>
<alleles>
<allele>0.27251556008507416</allele>
<allele>0.003140816229067145</allele>
<allele>0.43947528327497376</allele>
</alleles>
</double-chromosome>
| Modifier and Type | Method and Description |
|---|---|
static Writer<Double> |
alleleWriter()
Return the default double allele writer for the
DoubleChromosome. |
Class<DoubleChromosome> |
type() |
static void |
write(OutputStream out,
DoubleChromosome data)
Write the given
DoubleChromosome to the given
output stream. |
static void |
write(OutputStream out,
DoubleChromosome data,
String indent)
Write the given
DoubleChromosome to the given
output stream. |
static Writer<DoubleChromosome> |
writer()
Return a
Writer for DoubleChromosome
objects. |
static Writer<DoubleChromosome> |
writer(Writer<? super Double> alleleWriter)
Return a
Writer for DoubleChromosome
objects. |
public static Writer<Double> alleleWriter()
DoubleChromosome.public static Writer<DoubleChromosome> writer(Writer<? super Double> alleleWriter)
Writer for DoubleChromosome
objects.alleleWriter - the allele writer used for writing the long
allele. Might be useful for using different long
encodings.NullPointerException - if the given alleleWriter is
nullpublic static Writer<DoubleChromosome> writer()
Writer for DoubleChromosome
objects.public Class<DoubleChromosome> type()
public static void write(OutputStream out, DoubleChromosome data, String indent) throws XMLStreamException
DoubleChromosome to the given
output stream.out - the target output streamdata - the chromosome to writeindent - the XML level indentationXMLStreamException - if an error occurs while writing the
chromosomeNullPointerException - if the chromosome or output
stream is nullpublic static void write(OutputStream out, DoubleChromosome data) throws XMLStreamException
DoubleChromosome to the given
output stream.out - the target output streamdata - the chromosome to writeXMLStreamException - if an error occurs while writing the
chromosomeNullPointerException - if the chromosome or output
stream is null© 2007-2019 Franz Wilhelmstötter (2019-11-18 20:30)