Class GraphQueryResultIterator

  • All Implemented Interfaces:
    CloseableIterator<Statement>, StatementIterator, java.lang.AutoCloseable, java.util.Iterator<Statement>

    public final class GraphQueryResultIterator
    extends com.google.common.collect.AbstractIterator<Statement>
    implements StatementIterator

    Iteration implementation over graph query results. Optionally will apply a context to the results as they are returned so we can have the effect of doing construct queries which return statements w/ non-null contexts.

    Since:
    0.2
    Version:
    6.0
    Author:
    Michael Grove
    • Constructor Detail

      • GraphQueryResultIterator

        public GraphQueryResultIterator​(GraphQueryResult theResult)
        Create a new GraphQueryResultIteration
        Parameters:
        theResult - the query result
      • GraphQueryResultIterator

        public GraphQueryResultIterator​(GraphQueryResult theResult,
                                        Resource theContext)
        Create a new GQRIterator
        Parameters:
        theResult - the query result
        theContext - the context to be applied to the results, or null if the context should not be altered
    • Method Detail

      • namespaces

        public Namespaces namespaces()
        Returns namespaces associated with this statement iteration if any.
        Specified by:
        namespaces in interface StatementIterator
        Returns:
        possibly empty namespaces but never null
      • computeNext

        public Statement computeNext()
        Specified by:
        computeNext in class com.google.common.collect.AbstractIterator<Statement>