org.openrdf.query.impl
Class TupleQueryResultImpl

java.lang.Object
  extended by org.openrdf.query.impl.TupleQueryResultImpl
All Implemented Interfaces:
CloseableIteration<BindingSet,QueryEvaluationException>, Iteration<BindingSet,QueryEvaluationException>, QueryResult<BindingSet>, TupleQueryResult
Direct Known Subclasses:
BackgroundTupleResult

public class TupleQueryResultImpl
extends Object
implements TupleQueryResult

A generic implementation of the TupleQueryResult interface.


Constructor Summary
TupleQueryResultImpl(List<String> bindingNames, CloseableIteration<? extends BindingSet,QueryEvaluationException> bindingSetIter)
          Creates a query result object with the supplied binding names.
TupleQueryResultImpl(List<String> bindingNames, Iterable<? extends BindingSet> bindingSets)
          Creates a query result object with the supplied binding names.
TupleQueryResultImpl(List<String> bindingNames, Iterator<? extends BindingSet> bindingSetIter)
           
 
Method Summary
 void close()
          Closes this iteration, freeing any resources that it is holding.
 List<String> getBindingNames()
          Gets the names of the bindings, in order of projection.
 boolean hasNext()
          Returns true if the iteration has more elements.
 BindingSet next()
          Returns the next element in the iteration.
 void remove()
          Removes from the underlying collection the last element returned by the iteration (optional operation).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleQueryResultImpl

public TupleQueryResultImpl(List<String> bindingNames,
                            Iterable<? extends BindingSet> bindingSets)
Creates a query result object with the supplied binding names. The supplied list of binding names is assumed to be constant; care should be taken that the contents of this list doesn't change after supplying it to this solution.

Parameters:
bindingNames - The binding names, in order of projection.

TupleQueryResultImpl

public TupleQueryResultImpl(List<String> bindingNames,
                            Iterator<? extends BindingSet> bindingSetIter)

TupleQueryResultImpl

public TupleQueryResultImpl(List<String> bindingNames,
                            CloseableIteration<? extends BindingSet,QueryEvaluationException> bindingSetIter)
Creates a query result object with the supplied binding names. The supplied list of binding names is assumed to be constant; care should be taken that the contents of this list doesn't change after supplying it to this solution.

Parameters:
bindingNames - The binding names, in order of projection.
Method Detail

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
Returns:
The binding names, in order of projection.

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>
Throws:
QueryEvaluationException

hasNext

public boolean hasNext()
                throws QueryEvaluationException
Description copied from interface: Iteration
Returns true if the iteration has more elements. (In other words, returns true if Iteration.next() would return an element rather than throwing a NoSuchElementException.)

Specified by:
hasNext in interface Iteration<BindingSet,QueryEvaluationException>
Returns:
true if the iteration has more elements.
Throws:
QueryEvaluationException

next

public BindingSet next()
                throws QueryEvaluationException
Description copied from interface: Iteration
Returns the next element in the iteration.

Specified by:
next in interface Iteration<BindingSet,QueryEvaluationException>
Returns:
the next element in the iteration.
Throws:
QueryEvaluationException

remove

public void remove()
            throws QueryEvaluationException
Description copied from interface: Iteration
Removes from the underlying collection the last element returned by the iteration (optional operation). This method can be called only once per call to next.

Specified by:
remove in interface Iteration<BindingSet,QueryEvaluationException>
Throws:
QueryEvaluationException


Copyright © 2001-2012 Aduna. All Rights Reserved.