org.openrdf.sesame.sail.query
Class QueryResultsCounter

java.lang.Object
  extended byorg.openrdf.sesame.sail.query.QueryResultsCounter
All Implemented Interfaces:
QueryAnswerListener

public class QueryResultsCounter
extends Object
implements QueryAnswerListener

A QueryAnswerListener that counts the number of reported query results and forwards them to another QueryAnswerListener.


Constructor Summary
QueryResultsCounter()
          Creates a new QueryResultsCounter.
QueryResultsCounter(QueryAnswerListener l)
          Creates a new QueryResultsCounter that forwards any query results to the specified listener.
 
Method Summary
 void clear()
          Method called when the query engine has finished or aborted the query evaluation, signaling that the listener can/should clear any recorded and query-specific information.
 int getCount()
          Gets the number of query answers that has been counted.
 boolean queryAnswer(QueryAnswer qa)
          Reports a query answer to the listener.
 void resetCounter()
          Resets the counter to 0.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryResultsCounter

public QueryResultsCounter()
Creates a new QueryResultsCounter.


QueryResultsCounter

public QueryResultsCounter(QueryAnswerListener l)
Creates a new QueryResultsCounter that forwards any query results to the specified listener.

Parameters:
l - A QueryAnswerListener.
Method Detail

queryAnswer

public boolean queryAnswer(QueryAnswer qa)
                    throws IOException
Description copied from interface: QueryAnswerListener
Reports a query answer to the listener.

Specified by:
queryAnswer in interface QueryAnswerListener
Parameters:
qa - The query answer.
Returns:
A flag indicating whether the query engine should continue evaluating the (sub-)query.
Throws:
IOException

clear

public void clear()
Description copied from interface: QueryAnswerListener
Method called when the query engine has finished or aborted the query evaluation, signaling that the listener can/should clear any recorded and query-specific information.

Specified by:
clear in interface QueryAnswerListener

getCount

public int getCount()
Gets the number of query answers that has been counted.


resetCounter

public void resetCounter()
Resets the counter to 0.



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