org.openrdf.sesame.query
Interface TableQueryResultListener

All Known Implementing Classes:
BinaryTableResultWriter, HtmlTableWriter, QueryResultsTableBuilder, SecuritySail, TableQueryDuplicatesFilter, VarBindingRdfWriter, XmlQueryResultWriter

public interface TableQueryResultListener

A listener for table-like query results. The results are returned row-by-row. The values of the rows (tuples) are returned one after the other through the method tupleValue(Value). So a query result like:

ABC
XYZ

will result in the following calls to this listener:

 startTableQueryResult()
     startTuple()
         tupleValue(A)
         tupleValue(B)
         tupleValue(C)
     endTuple()
     startTuple()
         tupleValue(X)
         tupleValue(Y)
         tupleValue(Z)
     endTuple()
 endTableQueryResult()
 

Note1: only one of the startTableQueryResult() methods will be called.
Note2: in case of an error occuring during query evaluation, an error message will be reported using the reportError() method.


Method Summary
 void endTableQueryResult()
          Indicates the end of a table-like query result.
 void endTuple()
          Indicates the end of a tuple/row.
 void error(QueryErrorType errType, String msg)
          Reports an error that has occurred during the query evaluation.
 void startTableQueryResult()
          Indicates the start of a table-like query result.
 void startTableQueryResult(String[] columnHeaders)
          Indicates the start of a table-like query result.
 void startTuple()
          Indicates the start of a tuple/row.
 void tupleValue(Value value)
          Delivers the next value in the current tuple/row.
 

Method Detail

startTableQueryResult

public void startTableQueryResult()
                           throws IOException
Indicates the start of a table-like query result.

Throws:
IOException

startTableQueryResult

public void startTableQueryResult(String[] columnHeaders)
                           throws IOException
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.

Throws:
IOException

endTableQueryResult

public void endTableQueryResult()
                         throws IOException
Indicates the end of a table-like query result.

Throws:
IOException

startTuple

public void startTuple()
                throws IOException
Indicates the start of a tuple/row.

Throws:
IOException

endTuple

public void endTuple()
              throws IOException
Indicates the end of a tuple/row.

Throws:
IOException

tupleValue

public void tupleValue(Value value)
                throws IOException
Delivers the next value in the current tuple/row.

Parameters:
value - The next value in the current tuple/row.
Throws:
IOException

error

public void error(QueryErrorType errType,
                  String msg)
           throws IOException
Reports an error that has occurred during the query evaluation.

Parameters:
errType - The type of error.
msg - A message describing the error.
Throws:
IOException


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