Class 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.
    • Constructor Detail

      • ResultSetConsumer

        public ResultSetConsumer()
    • 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
      • getResultVars

        protected final List<String> getResultVars()
        Helper method to allow an implementation to get the var names from the resultset
        Returns:
        list of result set var names