org.openrdf.sesame.query
Class QueryResultsTableBuilder

java.lang.Object
  extended byorg.openrdf.sesame.query.QueryResultsTableBuilder
All Implemented Interfaces:
TableQueryResultListener

public class QueryResultsTableBuilder
extends Object
implements TableQueryResultListener

A TableQueryResultListener that can be used to build a QueryResultsTable.

See Also:
QueryResultsTable

Constructor Summary
QueryResultsTableBuilder()
          Creates a new QueryResultsTableBuilder.
 
Method Summary
 void clear()
          Clear the builder.
 void endTableQueryResult()
          Method needed by the TableQueryResultListener interface.
 void endTuple()
          Method needed by the TableQueryResultListener interface.
 void error(QueryErrorType errType, String msg)
          Reports an error that has occurred during the query evaluation.
 QueryResultsTable getQueryResultsTable()
          Gets the QueryResultsTable that has been built.
 void startTableQueryResult()
          Method needed by the TableQueryResultListener interface.
 void startTableQueryResult(String[] columnHeaders)
          Indicates the start of a table-like query result.
 void startTuple()
          Method needed by the TableQueryResultListener interface.
 void tupleValue(Value value)
          Method needed by the TableQueryResultListener interface.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryResultsTableBuilder

public QueryResultsTableBuilder()
Creates a new QueryResultsTableBuilder.

Method Detail

getQueryResultsTable

public QueryResultsTable getQueryResultsTable()
Gets the QueryResultsTable that has been built. This method only returns a table when the results have (partially) been parsed, and when the builder hasn't been cleared in the meantime. The table can be empty.

Returns:
A QueryResultsTable, or null if not available (this can happen when invoked before the query is evaluated). Note that an empty QueryResultsTable will be returned if the query had no results.

clear

public void clear()
Clear the builder. Any table that has been built so far will be removed.


startTableQueryResult

public void startTableQueryResult()
Method needed by the TableQueryResultListener interface.

Specified by:
startTableQueryResult in interface TableQueryResultListener

startTableQueryResult

public void startTableQueryResult(String[] columnHeaders)
Description copied from interface: TableQueryResultListener
Indicates the start of a table-like query result. The supplied columnHeaders are an indication of the values that are in a specific column. For example, a query select A, B from * .... could have column headers A and B.

Specified by:
startTableQueryResult in interface TableQueryResultListener

endTableQueryResult

public void endTableQueryResult()
Method needed by the TableQueryResultListener interface.

Specified by:
endTableQueryResult in interface TableQueryResultListener

startTuple

public void startTuple()
Method needed by the TableQueryResultListener interface.

Specified by:
startTuple in interface TableQueryResultListener

endTuple

public void endTuple()
Method needed by the TableQueryResultListener interface.

Specified by:
endTuple in interface TableQueryResultListener

tupleValue

public void tupleValue(Value value)
Method needed by the TableQueryResultListener interface.

Specified by:
tupleValue in interface TableQueryResultListener
Parameters:
value - The next value in the current tuple/row.

error

public void error(QueryErrorType errType,
                  String msg)
           throws IOException
Description copied from interface: TableQueryResultListener
Reports an error that has occurred during the query evaluation.

Specified by:
error in interface TableQueryResultListener
Parameters:
errType - The type of error.
msg - A message describing the error.
Throws:
IOException


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.