public class XMLResultWriter extends java.lang.Object implements ResultWriter
Constructor and Description |
---|
XMLResultWriter(java.io.OutputStream output,
ResultFileType resultType,
int seedIndex,
int batchNumber,
int totalNumberOfBatches,
java.lang.String logNameForErrorMessages)
Constructs a new XML result writer.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the writer and underlying streams.
|
static void |
setRoundingDigits(java.lang.Integer digits)
Set the number of significant digits for double output.
|
static void |
setRoundingDigits(java.lang.Integer digits,
java.math.RoundingMode mode)
Set the number of significant digits for double output.
|
void |
writeDouble(java.lang.String name,
double value)
A shorthand method for
|
void |
writeEndArray()
Writes the end of a result array.
|
void |
writeEndArrayItem()
Writes the end of a result array bucket.
|
void |
writeEndNode()
Writes the end of a result node.
|
void |
writeEndResults()
Writes the end of the results.
|
void |
writeLong(java.lang.String name,
long value)
A shorthand method for
|
void |
writeStartArray(java.lang.String name)
Writes the beginning of a result array.
|
void |
writeStartArrayItem(long index)
Writes the beginning of a result array bucket.
|
void |
writeStartNode(java.lang.String type,
java.lang.String name)
Writes the beginning of a result node.
|
void |
writeStartResults()
Writes the beginning of the results.
|
void |
writeString(java.lang.String name,
java.lang.String value)
A shorthand method for
|
public XMLResultWriter(java.io.OutputStream output, ResultFileType resultType, int seedIndex, int batchNumber, int totalNumberOfBatches, java.lang.String logNameForErrorMessages)
output
- the output stream for the XML result tree. The stream will not
be closed by this writerlogNameForErrorMessages
- public static void setRoundingDigits(java.lang.Integer digits)
digits
- the number of digits. Set to null to disable rounding.public static void setRoundingDigits(java.lang.Integer digits, java.math.RoundingMode mode)
digits
- the number of digits. Set to null to disable rounding.mode
- see RoundingMode
for possible modespublic void close() throws PrintException
ResultWriter
close
in interface ResultWriter
PrintException
public void writeStartResults() throws PrintException
ResultWriter
writeEndResults
.writeStartResults
in interface ResultWriter
PrintException
- if any error in writing the results occurspublic void writeEndResults() throws PrintException
ResultWriter
writeStartResults
and all other
writeStartXXX
must have been matched by their
writeEndXXX
counterparts.writeEndResults
in interface ResultWriter
PrintException
- if any error in writing the results occurspublic void writeDouble(java.lang.String name, double value) throws PrintException
ResultWriter
<code> writeDouble(value); writeName(name); </code>
writeDouble
in interface ResultWriter
name
- name of the resultvalue
- value of the resultPrintException
- if any error in writing the results occurspublic void writeEndArray() throws PrintException
ResultWriter
writeStartArray
.writeEndArray
in interface ResultWriter
PrintException
- if any error in writing the results occurspublic void writeEndArrayItem() throws PrintException
ResultWriter
writeStartBucket
.writeEndArrayItem
in interface ResultWriter
PrintException
- if any error in writing the results occurspublic void writeEndNode() throws PrintException
ResultWriter
writeStartNode
.writeEndNode
in interface ResultWriter
PrintException
- if any error in writing the results occurspublic void writeLong(java.lang.String name, long value) throws PrintException
ResultWriter
<code> writeLong(value); writeName(name); </code>
writeLong
in interface ResultWriter
name
- name of the resultvalue
- value of the resultPrintException
- if any error in writing the results occurspublic void writeStartArray(java.lang.String name) throws PrintException
ResultWriter
writeEndArray
.writeStartArray
in interface ResultWriter
PrintException
- if any error in writing the results occurspublic void writeStartArrayItem(long index) throws PrintException
ResultWriter
writeEndBucket
. It is only legal to call this method in an array.writeStartArrayItem
in interface ResultWriter
PrintException
- if any error in writing the results occurspublic void writeStartNode(java.lang.String type, java.lang.String name) throws PrintException
ResultWriter
writeEndNode
.writeStartNode
in interface ResultWriter
type
- of the result nodePrintException
- if any error in writing the results occurspublic void writeString(java.lang.String name, java.lang.String value) throws PrintException
ResultWriter
<code> writeString(value); writeName(name); </code>
writeString
in interface ResultWriter
name
- name of the resultvalue
- value of the resultPrintException
- if any error in writing the results occurs