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
Modifier and TypeFieldDescriptionprotected final boolean
A flag to determine whether to print keys in theprint(java.io.PrintWriter, String)
method if the value inf_oResult
is aMap
.protected final Object
The actual result of executing a CohQLStatement
.Fields inherited from interface com.tangosol.coherence.dslquery.StatementResult
NULL_RESULT
-
Constructor Summary
ConstructorDescriptionDefaultStatementResult
(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.void
print
(PrintWriter writer, String sTitle) Print the result object to the specifiedPrintWriter
.protected void
printCommaSeparatedCollection
(PrintWriter writer, Collection col) Print the contents of the givenCollection
to the specifiedPrintWriter
as a comma separated list.protected void
printObject
(PrintWriter writer, Object oResult, boolean fPrintNewLine, boolean fTopObject) Print out the given Object on the givenPrintWriter
.protected void
printResults
(PrintWriter writer, String sTitle, Object oResult, boolean fShowKeys) Print the specified result value to the specifiedPrintWriter
.protected void
printResultsCollection
(PrintWriter writer, Collection col, boolean fShowKeys) Print the givenCollection
of Objects on the givenPrintWriter
.protected void
printResultsMap
(PrintWriter writer, Map map, boolean fShowKey) Print the contents of the specifiedMap
to the specifiedPrintWriter
.protected 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.protected 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.
-
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_oResult
is 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 aMap
then 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:StatementResult
Return the actual result Object that this StatementResult wraps.- Specified by:
getResult
in interfaceStatementResult
- Returns:
- the actual result Object that this StatementResult wraps
-
print
Description copied from interface:StatementResult
Print the result object to the specifiedPrintWriter
.- Specified by:
print
in 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 givenCollection
to the specifiedPrintWriter
as 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 givenCollection
of 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 specifiedMap
to the specifiedPrintWriter
.- Parameters:
writer
- a PrintWriter to print onmap
- the Map to printfShowKey
- a flag controlling whether to print the Maps keys
-