* @param logFormatReport <i>true</i> to write a log entry (with nb rows and columns + writing duration) each time a result is written, <i>false</i> otherwise.
*
* @throws NullPointerException If the given service connection is <code>null</code>.
service.getLogger().logTAP(LogLevel.INFO,execReport,"FORMAT","Result formatted (in HTML ; "+nbRows+" rows ; "+columns.length+" columns) in "+(System.currentTimeMillis()-startTime)+"ms!",null);
}catch(Exceptionex){
service.getLogger().logTAP(LogLevel.ERROR,execReport,"FORMAT","Error while formatting in HTML!",ex);
}
}
/**
* Write the whole header (one row whose columns are just the columns' name).
*
* @param result Result to write later (but it contains also metadata that was extracted from the result itself).
* @param writer Output in which the metadata must be written.
* @param execReport Execution report (which contains the metadata extracted/guessed from the ADQL query).
* @param thread Thread which has asked for this formatting (it must be used in order to test the {@link Thread#isInterrupted()} flag and so interrupt everything if need).
*
* @return All the written metadata.
*
* @throws IOException If there is an error while writing something in the output.
* @throws InterruptedException If the thread has been interrupted.
// Go to a new line (in order to prepare the data writing):
writer.println("</tr>");
writer.println("</thead>");
writer.flush();
}
// Returns the written columns:
returnselectedColumns;
}
/**
* Write all the data rows.
*
* @param result Result to write.
* @param selectedColumns All columns' metadata.
* @param writer Print writer in which the data must be written.
* @param execReport Execution report (which contains the maximum allowed number of records to output).
* @param thread Thread which has asked for this formatting (it must be used in order to test the {@link Thread#isInterrupted()} flag and so interrupt everything if need).
*
* @return The number of written result rows. (<i>note: if this number is greater than the value of MAXREC: OVERFLOW</i>)
*
* @throws IOException If there is an error while writing something in the output stream.
* @throws InterruptedException If the thread has been interrupted.
if(execReport.parameters.getMaxRec()>0&&nbRows>=execReport.parameters.getMaxRec()){// that's to say: OVERFLOW !
writer.println("<tr class=\"OVERFLOW\"><td colspan=\""+selectedColumns.length+"\"><em><strong>OVERFLOW</strong> (more rows were available but have been truncated by the TAP service)</em></td></tr>");