Class DefaultStatementResult
java.lang.Object
com.tangosol.coherence.dslquery.statement.DefaultStatementResult
- All Implemented Interfaces:
 StatementResult
- Direct Known Subclasses:
 FormattedMapStatementResult
A default implementation of a 
StatementResult.- Since:
 - Coherence 12.2.1
 - Author:
 - jk 2014.07.15
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanA flag to determine whether to print keys in theprint(java.io.PrintWriter, String)method if the value inf_oResultis aMap.protected final ObjectThe actual result of executing a CohQLStatement.Fields inherited from interface com.tangosol.coherence.dslquery.StatementResult
NULL_RESULT - 
Constructor Summary
ConstructorsConstructorDescriptionDefaultStatementResult(Object oResult) Construct a DefaultStatementResult with the specified result value.DefaultStatementResult(Object oResult, boolean fShowKeys) Construct a DefaultStatementResult with the specified result value. - 
Method Summary
Modifier and TypeMethodDescriptionReturn the actual result Object that this StatementResult wraps.voidprint(PrintWriter writer, String sTitle) Print the result object to the specifiedPrintWriter.protected voidprintCommaSeparatedCollection(PrintWriter writer, Collection col) Print the contents of the givenCollectionto the specifiedPrintWriteras a comma separated list.protected voidprintObject(PrintWriter writer, Object oResult, boolean fPrintNewLine, boolean fTopObject) Print out the given Object on the givenPrintWriter.protected voidprintResults(PrintWriter writer, String sTitle, Object oResult, boolean fShowKeys) Print the specified result value to the specifiedPrintWriter.protected voidprintResultsCollection(PrintWriter writer, Collection col, boolean fShowKeys) Print the givenCollectionof Objects on the givenPrintWriter.protected voidprintResultsMap(PrintWriter writer, Map map, boolean fShowKey) Print the contents of the specifiedMapto the specifiedPrintWriter.protected voidprintStringOrObject(PrintWriter writer, Object o) If the given Object is a String print it within double quotes around otherwise pass the Object to theprintObject(PrintWriter, Object, boolean, boolean)method.protected voidprintStringOrObject(PrintWriter writer, Object o, boolean fNewLine) If the given Object is a String print it within double quotes around otherwise pass the Object to theprintObject(PrintWriter, Object, boolean, boolean)method. 
- 
Field Details
- 
f_oResult
The actual result of executing a CohQLStatement. - 
f_fShowKeys
protected final boolean f_fShowKeysA flag to determine whether to print keys in theprint(java.io.PrintWriter, String)method if the value inf_oResultis aMap. 
 - 
 - 
Constructor Details
- 
DefaultStatementResult
Construct a DefaultStatementResult with the specified result value.- Parameters:
 oResult- the result Object that this DefaultStatementResult contains
 - 
DefaultStatementResult
Construct a DefaultStatementResult with the specified result value.- Parameters:
 oResult- the result Object that this DefaultStatementResult containsfShowKeys- if true and oResult is aMapthen the keys of the Map will be printed by theprint(java.io.PrintWriter, String)method, if false, no keys will be printed
 
 - 
 - 
Method Details
- 
getResult
Description copied from interface:StatementResultReturn the actual result Object that this StatementResult wraps.- Specified by:
 getResultin interfaceStatementResult- Returns:
 - the actual result Object that this StatementResult wraps
 
 - 
print
Description copied from interface:StatementResultPrint the result object to the specifiedPrintWriter.- Specified by:
 printin interfaceStatementResult- Parameters:
 writer- the PrintWriter to print the results tosTitle- the title to print before the results
 - 
printResults
Print the specified result value to the specifiedPrintWriter.- Parameters:
 writer- the PrintWriter to print the results tosTitle- the optional title to print before the resultsoResult- the result object to printfShowKeys- a flag to determine whether to print keys if the result object is a map
 - 
printObject
protected void printObject(PrintWriter writer, Object oResult, boolean fPrintNewLine, boolean fTopObject) Print out the given Object on the givenPrintWriter.- Parameters:
 writer- a PrintWriter to print onoResult- the object to printfPrintNewLine- a flag controlling whether to print a new linefTopObject- a flag to tell whether the object is outermost
 - 
printCommaSeparatedCollection
Print the contents of the givenCollectionto the specifiedPrintWriteras a comma separated list.- Parameters:
 writer- the PrintWriter to print the Collection tocol- the Collection to print
 - 
printStringOrObject
If the given Object is a String print it within double quotes around otherwise pass the Object to theprintObject(PrintWriter, Object, boolean, boolean)method.- Parameters:
 writer- a PrintWriter to print ono- the object to print
 - 
printStringOrObject
If the given Object is a String print it within double quotes around otherwise pass the Object to theprintObject(PrintWriter, Object, boolean, boolean)method.- Parameters:
 writer- a PrintWriter to print ono- the object to printfNewLine- a flag controlling whether to print a new line
 - 
printResultsCollection
Print the givenCollectionof Objects on the givenPrintWriter.- Parameters:
 writer- a PrintWriter to print oncol- the Collection to printfShowKeys- true to show keys
 - 
printResultsMap
Print the contents of the specifiedMapto the specifiedPrintWriter.- Parameters:
 writer- a PrintWriter to print onmap- the Map to printfShowKey- a flag controlling whether to print the Maps keys
 
 -