public class FormattedMapStatementResult extends DefaultStatementResult
StatementResult which assumes the result is
a Map with value being a Object or Object[].
The caller may call setColumnHeaders to set the column header values and the
formatting of the results will be based upon the largest value in each column.f_fShowKeys, f_oResultNULL_RESULT| Constructor and Description |
|---|
FormattedMapStatementResult(Object oResult)
Construct an instance with the given result which will should be a
Map. |
| Modifier and Type | Method and Description |
|---|---|
void |
print(PrintWriter writer,
String sTitle)
Print the result object to the specified
PrintWriter. |
protected void |
printResultsObjectMap(PrintWriter writer,
Map map,
boolean fShowKey)
Print the contents of the specified
Map to the specified
PrintWriter and format as required. |
void |
setColumnHeaders(String[] asColumnHeaders)
Set the column headers to print.
|
getResult, printCommaSeparatedCollection, printObject, printResults, printResultsCollection, printResultsMap, printStringOrObject, printStringOrObjectpublic void print(PrintWriter writer, String sTitle)
PrintWriter.print in interface StatementResultprint in class DefaultStatementResultwriter - the PrintWriter to print the results tosTitle - the title to print before the resultsprotected void printResultsObjectMap(PrintWriter writer, Map map, boolean fShowKey)
Map to the specified
PrintWriter and format as required. The Map is assumed to
have values of either Object or Object[].writer - a PrintWriter to print onmap - the Map to printfShowKey - a flag controlling whether to print the Maps keyspublic void setColumnHeaders(String[] asColumnHeaders)
asColumnHeaders - the column headers to print