Class TextTableQueryResultWriter
java.lang.Object
com.complexible.common.rdf.query.resultio.AbstractDataExporterQueryResultWriter
com.complexible.common.rdf.query.resultio.TextTableQueryResultWriter
- All Implemented Interfaces:
QueryResultWriter<BindingSet>,SelectQueryResultWriter,QueryResultHandler<BindingSet>,SelectQueryResultHandler
- Direct Known Subclasses:
TextPathQueryResultWriter,TextTablePathQueryResultWriter
Implementation of
SelectQueryResultWriter interface to output a nice looking text table with many
customization options. The column widths can be calculated by prefetching a specified amount of results with the
possibility of specifying minimum and maximum widths to override automatically calculated values. Any value that
overflows the column will be printed on multiple lines where the other values in the same row will be top-aligned.- Author:
- Evren Sirin
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final QueryResultFormatThe format to identify this writer with name "TEXT", mime type "text/plain" and file extension "txt". -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.brsanthu.dataexporter.DataExporterCreates the exporter and sets its optionsvoidend()Signal that query processing has completedlongGets the current start time that will be used to display query execution time if summary is shown at the end.booleanReturns true if the number of results and query execution time will be shown at the end.voidsetShowSummary(boolean mShowSummary) Turns on showing query summary at the end of results which includes the number of results and query execution time.voidsetStartTime(long theStartTime) Sets the current start time that will be used to display query execution time if summary is shown at the end.Methods inherited from class com.complexible.common.rdf.query.resultio.AbstractDataExporterQueryResultWriter
addNamespaces, format, handle, links, namespace, start, variables
-
Field Details
-
FORMAT
The format to identify this writer with name "TEXT", mime type "text/plain" and file extension "txt".
-
-
Constructor Details
-
TextTableQueryResultWriter
-
-
Method Details
-
isShowSummary
public boolean isShowSummary()Returns true if the number of results and query execution time will be shown at the end.- Returns:
- a boolean indicating if the number of results will be shown
-
setShowSummary
public void setShowSummary(boolean mShowSummary) Turns on showing query summary at the end of results which includes the number of results and query execution time.- Parameters:
mShowSummary- A boolean indicating if the number of results and query execution time should be displayed
-
getStartTime
public long getStartTime()Gets the current start time that will be used to display query execution time if summary is shown at the end.- Returns:
- the start time for query execution
-
setStartTime
public void setStartTime(long theStartTime) Sets the current start time that will be used to display query execution time if summary is shown at the end.- Parameters:
theStartTime- the current start time of the query execution in the summary.
-
end
public void end()Signal that query processing has completed- Specified by:
endin interfaceQueryResultHandler<BindingSet>- Specified by:
endin interfaceQueryResultWriter<BindingSet>- Overrides:
endin classAbstractDataExporterQueryResultWriter
-
createExporter
protected com.brsanthu.dataexporter.DataExporter createExporter()Creates the exporter and sets its options- Specified by:
createExporterin classAbstractDataExporterQueryResultWriter- Returns:
- a DataExporter object
-