Class FormattedMapStatementResult
- java.lang.Object
-
- com.tangosol.coherence.dslquery.statement.DefaultStatementResult
-
- com.tangosol.coherence.dslquery.statement.FormattedMapStatementResult
-
- All Implemented Interfaces:
StatementResult
public class FormattedMapStatementResult extends DefaultStatementResult
An implementation of aStatementResult
which assumes the result is aMap
with value being aObject
orObject
[]. 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.- Since:
- 12.2.1
- Author:
- tam 2014.08.05
-
-
Field Summary
-
Fields inherited from class com.tangosol.coherence.dslquery.statement.DefaultStatementResult
f_fShowKeys, f_oResult
-
Fields inherited from interface com.tangosol.coherence.dslquery.StatementResult
NULL_RESULT
-
-
Constructor Summary
Constructors Constructor Description FormattedMapStatementResult(Object oResult)
Construct an instance with the given result which will should be aMap
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
print(PrintWriter writer, String sTitle)
Print the result object to the specifiedPrintWriter
.protected void
printResultsObjectMap(PrintWriter writer, Map map, boolean fShowKey)
Print the contents of the specifiedMap
to the specifiedPrintWriter
and format as required.void
setColumnHeaders(String[] asColumnHeaders)
Set the column headers to print.-
Methods inherited from class com.tangosol.coherence.dslquery.statement.DefaultStatementResult
getResult, printCommaSeparatedCollection, printObject, printResults, printResultsCollection, printResultsMap, printStringOrObject, printStringOrObject
-
-
-
-
Method Detail
-
print
public void print(PrintWriter writer, String sTitle)
Print the result object to the specifiedPrintWriter
.- Specified by:
print
in interfaceStatementResult
- Overrides:
print
in classDefaultStatementResult
- Parameters:
writer
- the PrintWriter to print the results tosTitle
- the title to print before the results
-
printResultsObjectMap
protected void printResultsObjectMap(PrintWriter writer, Map map, boolean fShowKey)
Print the contents of the specifiedMap
to the specifiedPrintWriter
and format as required. TheMap
is assumed to have values of eitherObject
orObject
[].- Parameters:
writer
- a PrintWriter to print onmap
- the Map to printfShowKey
- a flag controlling whether to print the Maps keys
-
setColumnHeaders
public void setColumnHeaders(String[] asColumnHeaders)
Set the column headers to print.- Parameters:
asColumnHeaders
- the column headers to print
-
-