Class DefaultEvaluationStrategy.TimedIterator
java.lang.Object
org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<BindingSet, QueryEvaluationException>
org.eclipse.rdf4j.common.iteration.IterationWrapper<BindingSet, QueryEvaluationException>
org.eclipse.rdf4j.query.algebra.evaluation.impl.DefaultEvaluationStrategy.TimedIterator
- All Implemented Interfaces:
AutoCloseable, CloseableIteration<BindingSet, QueryEvaluationException>, Iteration<BindingSet, QueryEvaluationException>
- Enclosing class:
DefaultEvaluationStrategy
private static class DefaultEvaluationStrategy.TimedIterator
extends IterationWrapper<BindingSet, QueryEvaluationException>
This class wraps an iterator and tracks the time used to execute next() and hasNext()
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) CloseableIteration<BindingSet, QueryEvaluationException> (package private) QueryModelNode(package private) com.google.common.base.StopwatchFields inherited from class IterationWrapper
wrappedIter -
Constructor Summary
ConstructorsConstructorDescriptionTimedIterator(CloseableIteration<BindingSet, QueryEvaluationException> iterator, QueryModelNode queryModelNode) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCloses this Iteration and also closes the wrapped Iteration if it is aCloseableIteration.booleanhasNext()Checks whether the wrapped Iteration contains more elements, closing this Iteration when this is not the case.next()Returns the next element from the wrapped Iteration.Methods inherited from class IterationWrapper
removeMethods inherited from class AbstractCloseableIteration
close, isClosedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CloseableIteration
stream
-
Field Details
-
iterator
CloseableIteration<BindingSet, QueryEvaluationException> iterator -
queryModelNode
QueryModelNode queryModelNode -
stopwatch
com.google.common.base.Stopwatch stopwatch
-
-
Constructor Details
-
TimedIterator
public TimedIterator(CloseableIteration<BindingSet, QueryEvaluationException> iterator, QueryModelNode queryModelNode)
-
-
Method Details
-
next
Description copied from class:IterationWrapperReturns the next element from the wrapped Iteration.- Specified by:
nextin interfaceIteration<BindingSet, QueryEvaluationException>- Overrides:
nextin classIterationWrapper<BindingSet, QueryEvaluationException>- Returns:
- the next element in the iteration.
- Throws:
QueryEvaluationException
-
hasNext
Description copied from class:IterationWrapperChecks whether the wrapped Iteration contains more elements, closing this Iteration when this is not the case.- Specified by:
hasNextin interfaceIteration<BindingSet, QueryEvaluationException>- Overrides:
hasNextin classIterationWrapper<BindingSet, QueryEvaluationException>- Returns:
- true if the wrapped Iteration contains more elements, false otherwise.
- Throws:
QueryEvaluationException
-
handleClose
Description copied from class:IterationWrapperCloses this Iteration and also closes the wrapped Iteration if it is aCloseableIteration.- Overrides:
handleClosein classIterationWrapper<BindingSet, QueryEvaluationException>- Throws:
QueryEvaluationException
-