public class DefaultStatementResult extends Object implements StatementResult
StatementResult
.Modifier and Type | Field and Description |
---|---|
protected boolean |
f_fShowKeys
A flag to determine whether to print keys in the
print(java.io.PrintWriter, String)
method if the value in f_oResult is a Map . |
protected Object |
f_oResult
The actual result of executing a CohQL
Statement . |
NULL_RESULT
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
Object |
getResult()
Return the actual result Object that this StatementResult wraps.
|
void |
print(PrintWriter writer,
String sTitle)
Print the result object to the specified
PrintWriter . |
protected void |
printCommaSeparatedCollection(PrintWriter writer,
Collection col)
Print the contents of the given
Collection to the specified
PrintWriter as a comma separated list. |
protected void |
printObject(PrintWriter writer,
Object oResult,
boolean fPrintNewLine,
boolean fTopObject)
Print out the given Object on the given
PrintWriter . |
protected void |
printResults(PrintWriter writer,
String sTitle,
Object oResult,
boolean fShowKeys)
Print the specified result value to the specified
PrintWriter . |
protected void |
printResultsCollection(PrintWriter writer,
Collection col,
boolean fShowKeys)
Print the given
Collection of Objects on the given PrintWriter . |
protected void |
printResultsMap(PrintWriter writer,
Map map,
boolean fShowKey)
Print the contents of the specified
Map to the specified
PrintWriter . |
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 the
printObject(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 the
printObject(PrintWriter, Object, boolean, boolean) method. |
protected final boolean f_fShowKeys
print(java.io.PrintWriter, String)
method if the value in f_oResult
is a Map
.public DefaultStatementResult(Object oResult)
oResult
- the result Object that this DefaultStatementResult containspublic DefaultStatementResult(Object oResult, boolean fShowKeys)
oResult
- the result Object that this DefaultStatementResult containsfShowKeys
- if true and oResult is a Map
then the keys of the Map
will be printed by the print(java.io.PrintWriter, String)
method,
if false, no keys will be printedpublic Object getResult()
StatementResult
getResult
in interface StatementResult
public void print(PrintWriter writer, String sTitle)
StatementResult
PrintWriter
.print
in interface StatementResult
writer
- the PrintWriter to print the results tosTitle
- the title to print before the resultsprotected void printResults(PrintWriter writer, String sTitle, Object oResult, boolean fShowKeys)
PrintWriter
.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 mapprotected void printObject(PrintWriter writer, Object oResult, boolean fPrintNewLine, boolean fTopObject)
PrintWriter
.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 outermostprotected void printCommaSeparatedCollection(PrintWriter writer, Collection col)
Collection
to the specified
PrintWriter
as a comma separated list.writer
- the PrintWriter to print the Collection tocol
- the Collection to printprotected void printStringOrObject(PrintWriter writer, Object o)
printObject(PrintWriter, Object, boolean, boolean)
method.writer
- a PrintWriter to print ono
- the object to printprotected void printStringOrObject(PrintWriter writer, Object o, boolean fNewLine)
printObject(PrintWriter, Object, boolean, boolean)
method.writer
- a PrintWriter to print ono
- the object to printfNewLine
- a flag controlling whether to print a new lineprotected void printResultsCollection(PrintWriter writer, Collection col, boolean fShowKeys)
Collection
of Objects on the given PrintWriter
.writer
- a PrintWriter to print oncol
- the Collection to printfShowKeys
- true to show keysprotected void printResultsMap(PrintWriter writer, Map map, boolean fShowKey)
Map
to the specified
PrintWriter
.writer
- a PrintWriter to print onmap
- the Map to printfShowKey
- a flag controlling whether to print the Maps keys