org.openrdf.query.resultio.binary
Class BinaryQueryResultWriter

java.lang.Object
  extended by org.openrdf.query.resultio.binary.BinaryQueryResultWriter
All Implemented Interfaces:
TupleQueryResultWriter, TupleQueryResultHandler

public class BinaryQueryResultWriter
extends Object
implements TupleQueryResultWriter

Writer for the binary tuple result format. The format is explained in BinaryQueryResultConstants.

Author:
Arjohn Kampman

Constructor Summary
BinaryQueryResultWriter(OutputStream out)
           
 
Method Summary
 void endQueryResult()
          Indicates the end of a sequence of solutions.
 void error(QueryErrorType errType, String msg)
          Writes an error msg to the stream.
 TupleQueryResultFormat getTupleQueryResultFormat()
          Gets the query result format that this writer uses.
 void handleSolution(BindingSet bindingSet)
          Handles a solution.
 void startQueryResult(List<String> bindingNames)
          Indicates the start of a sequence of Solutions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryQueryResultWriter

public BinaryQueryResultWriter(OutputStream out)
Method Detail

getTupleQueryResultFormat

public final TupleQueryResultFormat getTupleQueryResultFormat()
Description copied from interface: TupleQueryResultWriter
Gets the query result format that this writer uses.

Specified by:
getTupleQueryResultFormat in interface TupleQueryResultWriter

startQueryResult

public void startQueryResult(List<String> bindingNames)
                      throws TupleQueryResultHandlerException
Description copied from interface: TupleQueryResultHandler
Indicates the start of a sequence of Solutions. The supplied bindingNames are an indication of the values that are in the Solutions. For example, a SeRQL query like select X, Y from {X} P {Y} will have binding names X and Y.

Specified by:
startQueryResult in interface TupleQueryResultHandler
Parameters:
bindingNames - An ordered set of binding names.
Throws:
TupleQueryResultHandlerException

endQueryResult

public void endQueryResult()
                    throws TupleQueryResultHandlerException
Description copied from interface: TupleQueryResultHandler
Indicates the end of a sequence of solutions.

Specified by:
endQueryResult in interface TupleQueryResultHandler
Throws:
TupleQueryResultHandlerException

handleSolution

public void handleSolution(BindingSet bindingSet)
                    throws TupleQueryResultHandlerException
Description copied from interface: TupleQueryResultHandler
Handles a solution.

Specified by:
handleSolution in interface TupleQueryResultHandler
Throws:
TupleQueryResultHandlerException

error

public void error(QueryErrorType errType,
                  String msg)
           throws IOException
Writes an error msg to the stream.

Parameters:
errType - The error type.
msg - The error message.
Throws:
IOException - When the error could not be written to the stream.


Copyright © 2001-2007 Aduna. All Rights Reserved.