public static final class Writers.LongChromosome extends Object
LongChromosome
objects.
Writer code
final LongChromosome value = LongChromosome
.of(Long.MIN_VALUE, Long.MAX_VALUE, 3);
try (AutoCloseableXMLStreamWriter xml = XML.writer(System.out, " ")) {
Writers.LongChromosome.writer().write(value, xml);
}
<long-chromosome length="3">
<min>-9223372036854775808</min>
<max>9223372036854775807</max>
<alleles>
<allele>-1345217698116542402</allele>
<allele>-7144755673073475303</allele>
<allele>6053786736809578435</allele>
</alleles>
</long-chromosome>
Modifier and Type | Method and Description |
---|---|
static Writer<Long> |
alleleWriter()
Return the default long allele writer for the
IntegerChromosome . |
static void |
write(OutputStream out,
LongChromosome data)
Write the given
LongChromosome to the given
output stream. |
static void |
write(OutputStream out,
LongChromosome data,
String indent)
Write the given
LongChromosome to the given
output stream. |
static Writer<LongChromosome> |
writer()
Return a
Writer for LongChromosome
objects. |
static Writer<LongChromosome> |
writer(Writer<? super Long> alleleWriter)
Return a
Writer for LongChromosome
objects. |
public static Writer<Long> alleleWriter()
IntegerChromosome
.public static Writer<LongChromosome> writer(Writer<? super Long> alleleWriter)
Writer
for LongChromosome
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
null
public static Writer<LongChromosome> writer()
Writer
for LongChromosome
objects.public static void write(OutputStream out, LongChromosome data, String indent) throws XMLStreamException
LongChromosome
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 null
public static void write(OutputStream out, LongChromosome data) throws XMLStreamException
LongChromosome
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-2017 Franz Wilhelmstötter (2017-11-16 20:01)