Class DefaultStatementResult
- java.lang.Object
- 
- com.tangosol.coherence.dslquery.statement.DefaultStatementResult
 
- 
- All Implemented Interfaces:
- StatementResult
 - Direct Known Subclasses:
- FormattedMapStatementResult
 
 public class DefaultStatementResult extends Object implements StatementResult A default implementation of aStatementResult.- Since:
- Coherence 12.2.1
- Author:
- jk 2014.07.15
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected booleanf_fShowKeysA flag to determine whether to print keys in theprint(java.io.PrintWriter, String)method if the value inf_oResultis aMap.protected Objectf_oResultThe actual result of executing a CohQLStatement.- 
Fields inherited from interface com.tangosol.coherence.dslquery.StatementResultNULL_RESULT
 
- 
 - 
Constructor SummaryConstructors Constructor Description DefaultStatementResult(Object oResult)Construct a DefaultStatementResult with the specified result value.DefaultStatementResult(Object oResult, boolean fShowKeys)Construct a DefaultStatementResult with the specified result value.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetResult()Return 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 Detail- 
f_fShowKeysprotected final boolean f_fShowKeys A flag to determine whether to print keys in theprint(java.io.PrintWriter, String)method if the value inf_oResultis aMap.
 
- 
 - 
Constructor Detail- 
DefaultStatementResultpublic DefaultStatementResult(Object oResult) Construct a DefaultStatementResult with the specified result value.- Parameters:
- oResult- the result Object that this DefaultStatementResult contains
 
 - 
DefaultStatementResultpublic DefaultStatementResult(Object oResult, boolean fShowKeys) Construct a DefaultStatementResult with the specified result value.- Parameters:
- oResult- the result Object that this DefaultStatementResult contains
- fShowKeys- if true and oResult is a- Mapthen the keys of the Map will be printed by the- print(java.io.PrintWriter, String)method, if false, no keys will be printed
 
 
- 
 - 
Method Detail- 
getResultpublic Object getResult() Description copied from interface:StatementResultReturn the actual result Object that this StatementResult wraps.- Specified by:
- getResultin interface- StatementResult
- Returns:
- the actual result Object that this StatementResult wraps
 
 - 
printpublic void print(PrintWriter writer, String sTitle) Description copied from interface:StatementResultPrint the result object to the specifiedPrintWriter.- Specified by:
- printin interface- StatementResult
- Parameters:
- writer- the PrintWriter to print the results to
- sTitle- the title to print before the results
 
 - 
printResultsprotected void printResults(PrintWriter writer, String sTitle, Object oResult, boolean fShowKeys) Print the specified result value to the specifiedPrintWriter.- Parameters:
- writer- the PrintWriter to print the results to
- sTitle- the optional title to print before the results
- oResult- the result object to print
- fShowKeys- a flag to determine whether to print keys if the result object is a map
 
 - 
printObjectprotected void printObject(PrintWriter writer, Object oResult, boolean fPrintNewLine, boolean fTopObject) Print out the given Object on the givenPrintWriter.- Parameters:
- writer- a PrintWriter to print on
- oResult- the object to print
- fPrintNewLine- a flag controlling whether to print a new line
- fTopObject- a flag to tell whether the object is outermost
 
 - 
printCommaSeparatedCollectionprotected void printCommaSeparatedCollection(PrintWriter writer, Collection col) Print the contents of the givenCollectionto the specifiedPrintWriteras a comma separated list.- Parameters:
- writer- the PrintWriter to print the Collection to
- col- the Collection to print
 
 - 
printStringOrObjectprotected void printStringOrObject(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.- Parameters:
- writer- a PrintWriter to print on
- o- the object to print
 
 - 
printStringOrObjectprotected void printStringOrObject(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.- Parameters:
- writer- a PrintWriter to print on
- o- the object to print
- fNewLine- a flag controlling whether to print a new line
 
 - 
printResultsCollectionprotected void printResultsCollection(PrintWriter writer, Collection col, boolean fShowKeys) Print the givenCollectionof Objects on the givenPrintWriter.- Parameters:
- writer- a PrintWriter to print on
- col- the Collection to print
- fShowKeys- true to show keys
 
 - 
printResultsMapprotected void printResultsMap(PrintWriter writer, Map map, boolean fShowKey) Print the contents of the specifiedMapto the specifiedPrintWriter.- Parameters:
- writer- a PrintWriter to print on
- map- the Map to print
- fShowKey- a flag controlling whether to print the Maps keys
 
 
- 
 
-