|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hp.hpl.jena.rdql.QueryResultsFormatter
Takes a QueryResult object and returns formatted (in various ways) Useful for the scripting interface. May help for display in other contexts.
Note: this is compute intensive and memory intensive. It needs to read all the results first (all the results are now in-memory - not kept here) in order to find things like the maximum length of a column value; then it needs to pass over the results again, turning them into Strings again, in order to return them.
We prefer slow and less memory intensive because it is more rebust for scripting.
Don't keep QueryResultsFormatter's around unnecessarily!
Field Summary | |
static java.lang.String |
resultsNamespace
|
Constructor Summary | |
QueryResultsFormatter(QueryResults qresults)
Create a formatter for a QueryResults object |
Method Summary | |
Resource |
asRDF(Model model)
Encode the result set as RDF in the model provided. |
void |
close()
Forcefully clearup. |
void |
consume()
This operation faithfully walks the results but does nothing with them. |
void |
dump(java.io.PrintWriter pw,
boolean format)
Write out a compact form. |
int |
numColumns()
How wide is the result table |
int |
numRows()
How deep is the result table. |
void |
printAll(java.io.PrintWriter printwriter)
Textual representation : default layout using " | " to separate columns |
void |
printAll(java.io.PrintWriter printwriter,
java.lang.String colSep)
Textual representation : layout using given separator |
void |
printAll(java.io.PrintWriter printwriter,
java.lang.String colSep,
java.lang.String lineEnd)
Textual representation : layout using given separator |
void |
printHTML(java.io.PrintWriter pw)
HTML representation |
Model |
toModel()
Encode the result set as RDF. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String resultsNamespace
Constructor Detail |
public QueryResultsFormatter(QueryResults qresults)
Method Detail |
public int numColumns()
public int numRows()
public void close()
public Model toModel()
public Resource asRDF(Model model)
model
- The place where to put the RDF.
public void dump(java.io.PrintWriter pw, boolean format)
public void printAll(java.io.PrintWriter printwriter)
printwriter
- Outputpublic void printAll(java.io.PrintWriter printwriter, java.lang.String colSep)
printwriter
- OutputcolSep
- Column separatorpublic void printAll(java.io.PrintWriter printwriter, java.lang.String colSep, java.lang.String lineEnd)
printwriter
- OutputcolSep
- Column separatorlineEnd
- String to add to end of linespublic void printHTML(java.io.PrintWriter pw)
public void consume()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |