Class ResultSetConsumer
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer
-
- Direct Known Subclasses:
ResultSetConsumer.Chaining,ResultSetConsumer.HasResult
public abstract class ResultSetConsumer extends Object
Base class for creating consumers of ResultSets processQuerySolution MUST be overridden - it takes each QuerySolution in turn until the ResultSet is complete startProcessing and endProcessing may be overridden if the implementation needs to know when the processing starts, or when there are no more solutions left to process.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classResultSetConsumer.ChainingHelper implemenation of ResutSetConsumer that can be used to wrap another ResultSetConsumer - useful for filtering implementationsstatic classResultSetConsumer.HasResultHelper implementation that allows you to find out simply if there were any results in the ResultSet
-
Constructor Summary
Constructors Constructor Description ResultSetConsumer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidendProcessing()Method to notify the consumer that all QuerySolutions have been processedprotected List<String>getResultVars()Helper method to allow an implementation to get the var names from the resultsetprotected abstract voidprocessQuerySolution(org.apache.jena.query.QuerySolution qs)Method for processing each QuerySolution - must be overridden in each implementationvoidprocessResultSet(org.apache.jena.query.ResultSet rs)Helper method that ensures the start / end processing is done correctlyprotected voidstartProcessing()Method to notify the consumer that a ResultSet is valid and is about to be processed
-
-
-
Method Detail
-
processQuerySolution
protected abstract void processQuerySolution(org.apache.jena.query.QuerySolution qs)
Method for processing each QuerySolution - must be overridden in each implementation- Parameters:
qs- - the current query solution
-
startProcessing
protected void startProcessing()
Method to notify the consumer that a ResultSet is valid and is about to be processed
-
endProcessing
protected void endProcessing()
Method to notify the consumer that all QuerySolutions have been processed
-
processResultSet
public void processResultSet(org.apache.jena.query.ResultSet rs)
Helper method that ensures the start / end processing is done correctly- Parameters:
rs- - the ResultSet to process
-
-