public static final class Writers.PermutationChromosome extends Object
PermutationChromosome
objects.
Writer code
final PermutationChromosome<Integer> value =
PermutationChromosome.ofInteger(5)
final Writer<PermutationChromosome<Integer> writer =
Writers.PermutationChromosome.writer();
try (AutoCloseableXMLStreamWriter xml = XML.writer(System.out, " ")) {
Writers.PermutationChromosome.writer().write(value, xml);
}
<permutation-chromosome length="5">
<valid-alleles type="java.lang.Integer">
<allele>0</allele>
<allele>1</allele>
<allele>2</allele>
<allele>3</allele>
<allele>4</allele>
</valid-alleles>
<order>2 1 3 5 4</order>
</permutation-chromosome>
Modifier and Type | Method and Description |
---|---|
static <A> void |
write(OutputStream out,
PermutationChromosome<A> data)
Write the given
PermutationChromosome to the
given output stream. |
static <A> void |
write(OutputStream out,
PermutationChromosome<A> data,
String indent)
Write the given
PermutationChromosome to the
given output stream. |
static <A> void |
write(OutputStream out,
PermutationChromosome<A> data,
String indent,
Writer<? super A> alleleWriter)
Write the given
PermutationChromosome to the
given output stream. |
static <A> void |
write(OutputStream out,
PermutationChromosome<A> data,
Writer<? super A> alleleWriter)
Write the given
PermutationChromosome to the
given output stream. |
static <A> Writer<PermutationChromosome<A>> |
writer()
Create a writer for permutation-chromosomes.
|
static <A> Writer<PermutationChromosome<A>> |
writer(Writer<? super A> alleleWriter)
Create a writer for permutation-chromosomes.
|
public static <A> Writer<PermutationChromosome<A>> writer(Writer<? super A> alleleWriter)
Writer
.A
- the allele typealleleWriter
- the allele writerNullPointerException
- if the given allele writer
is
null
public static <A> Writer<PermutationChromosome<A>> writer()
Object.toString()
method. Calling
this method is equivalent with:
final Writer<PermutationChromosome<Double> writer =
PermutationChromosome.write(text().map(Objects::toString));
<permutation-chromosome length="15">
<valid-alleles type="java.lang.Double">
<allele>0.27251556008507416</allele>
<allele>0.003140816229067145</allele>
<allele>0.43947528327497376</allele>
<allele>0.10654807463069327</allele>
<allele>0.19696530915810317</allele>
<allele>0.7450003838065538</allele>
<allele>0.5594416969271359</allele>
<allele>0.02823782430152355</allele>
<allele>0.5741102315010789</allele>
<allele>0.4533651041367144</allele>
<allele>0.811148141800367</allele>
<allele>0.5710456351848858</allele>
<allele>0.30166768355230955</allele>
<allele>0.5455492865240272</allele>
<allele>0.21068427527733102</allele>
</valid-alleles>
<order>13 12 4 6 8 14 7 2 11 5 3 0 9 10 1</order>
</permutation-chromosome>
A
- the allele typepublic static <A> void write(OutputStream out, PermutationChromosome<A> data, String indent) throws XMLStreamException
PermutationChromosome
to the
given output stream.A
- the allele typeout
- 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 <A> void write(OutputStream out, PermutationChromosome<A> data, String indent, Writer<? super A> alleleWriter) throws XMLStreamException
PermutationChromosome
to the
given output stream.A
- the allele typeout
- the target output streamdata
- the chromosome to writeindent
- the XML level indentationalleleWriter
- the allele writer of the permutation chromosomeXMLStreamException
- if an error occurs while writing the
chromosomeNullPointerException
- if the chromosome
or output
stream is null
public static <A> void write(OutputStream out, PermutationChromosome<A> data) throws XMLStreamException
PermutationChromosome
to the
given output stream.A
- the allele typeout
- the target output streamdata
- the chromosome to writeXMLStreamException
- if an error occurs while writing the
chromosomeNullPointerException
- if the chromosome
or output
stream is null
public static <A> void write(OutputStream out, PermutationChromosome<A> data, Writer<? super A> alleleWriter) throws XMLStreamException
PermutationChromosome
to the
given output stream.A
- the allele typeout
- the target output streamdata
- the chromosome to writealleleWriter
- the allele writer used to write the chromosome
allelesXMLStreamException
- if an error occurs while writing the
chromosomeNullPointerException
- if the chromosome
or output
stream is null
© 2007-2018 Franz Wilhelmstötter (2018-02-14 08:27)