Package com.complexible.common.rdf.query
Class GraphQueryResultIterator
- java.lang.Object
-
- com.google.common.collect.UnmodifiableIterator<T>
-
- com.google.common.collect.AbstractIterator<Statement>
-
- com.complexible.common.rdf.query.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.complexible.common.base.CloseableIterator
CloseableIterator.AbstractCloseableIterator<T>, CloseableIterator.DelegatingCloseableIterator<T>, CloseableIterator.EmptyCloseableIterator<T>
-
-
Constructor Summary
Constructors Constructor Description GraphQueryResultIterator(GraphQueryResult theResult)
Create a new GraphQueryResultIterationGraphQueryResultIterator(GraphQueryResult theResult, Resource theContext)
Create a new GQRIterator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Statement
computeNext()
Namespaces
namespaces()
Returns namespaces associated with this statement iteration if any.-
Methods inherited from class com.google.common.collect.AbstractIterator
endOfData, hasNext, next, peek
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.complexible.common.rdf.StatementIterator
process, toGraph
-
-
-
-
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 resulttheContext
- 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 interfaceStatementIterator
- Returns:
- possibly empty namespaces but never
null
-
computeNext
public Statement computeNext()
- Specified by:
computeNext
in classcom.google.common.collect.AbstractIterator<Statement>
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceCloseableIterator<Statement>
-
-