org.openrdf.repository.sparql.query
Class BackgroundTupleResult

java.lang.Object
  extended by org.openrdf.query.impl.TupleQueryResultImpl
      extended by org.openrdf.repository.sparql.query.BackgroundTupleResult
All Implemented Interfaces:
CloseableIteration<BindingSet,QueryEvaluationException>, Iteration<BindingSet,QueryEvaluationException>, Runnable, QueryResult<BindingSet>, TupleQueryResult, TupleQueryResultHandler

public class BackgroundTupleResult
extends TupleQueryResultImpl
implements TupleQueryResult, Runnable, TupleQueryResultHandler

Provides concurrent access to tuple results as they are being parsed.

Author:
James Leigh

Constructor Summary
BackgroundTupleResult(QueueCursor<BindingSet> queue, TupleQueryResultParser parser, InputStream in, org.apache.commons.httpclient.HttpMethod connection)
           
BackgroundTupleResult(TupleQueryResultParser parser, InputStream in, org.apache.commons.httpclient.HttpMethod connection)
           
 
Method Summary
 void close()
          Closes this iteration, freeing any resources that it is holding.
 void endQueryResult()
          Indicates the end of a sequence of solutions.
 List<String> getBindingNames()
          Gets the names of the bindings, in order of projection.
 void handleSolution(BindingSet bindingSet)
          Handles a solution.
 void run()
           
 void startQueryResult(List<String> bindingNames)
          Indicates the start of a sequence of Solutions.
 
Methods inherited from class org.openrdf.query.impl.TupleQueryResultImpl
hasNext, next, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.aduna.iteration.Iteration
hasNext, next, remove
 

Constructor Detail

BackgroundTupleResult

public BackgroundTupleResult(TupleQueryResultParser parser,
                             InputStream in,
                             org.apache.commons.httpclient.HttpMethod connection)

BackgroundTupleResult

public BackgroundTupleResult(QueueCursor<BindingSet> queue,
                             TupleQueryResultParser parser,
                             InputStream in,
                             org.apache.commons.httpclient.HttpMethod connection)
Method Detail

close

public void close()
           throws QueryEvaluationException
Description copied from interface: CloseableIteration
Closes this iteration, freeing any resources that it is holding. If the iteration has already been closed then invoking this method has no effect.

Specified by:
close in interface CloseableIteration<BindingSet,QueryEvaluationException>
Overrides:
close in class TupleQueryResultImpl
Throws:
QueryEvaluationException

getBindingNames

public List<String> getBindingNames()
Description copied from interface: TupleQueryResult
Gets the names of the bindings, in order of projection.

Specified by:
getBindingNames in interface TupleQueryResult
Overrides:
getBindingNames in class TupleQueryResultImpl
Returns:
The binding names, in order of projection.

run

public void run()
Specified by:
run in interface Runnable

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

handleSolution

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

Specified by:
handleSolution in interface TupleQueryResultHandler
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


Copyright © 2001-2012 Aduna. All Rights Reserved.