Package com.complexible.common.rdf.query

# Class IteratorAsQueryResult<T>

java.lang.Object
com.google.common.collect.UnmodifiableIterator<T>
com.google.common.collect.AbstractIterator<T>
com.complexible.common.rdf.query.IteratorAsQueryResult<T>

All Implemented Interfaces:
  `CloseableIterator<T>`, `AutoCloseable`, `Iterator<T>`

Direct Known Subclasses:
  `IteratorAsBooleanQueryResult`, `IteratorAsGraphQueryResult`, `IteratorAsPathQueryResult`, `IteratorAsTupleQueryResult`

public abstract class IteratorAsQueryResult<T> extends com.google.common.collect.AbstractIterator<T> implements CloseableIterator<T>
Base super-class for all iterator-as-query-result classes. It handles the on-success, on-failure, and on-close callbacks.

Author:
  Pavel Klinov

- ## 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
  `IteratorAsQueryResult(CloseableIterator<T> theIter, Runnable theOnClose, Runnable theOnSuccess)`
  `IteratorAsQueryResult(CloseableIterator<T> theIter, Runnable theOnClose, Runnable theOnSuccess, Function<Exception,RuntimeException> theOnError)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `protected T`
  `computeNext()`

  ### Methods inherited from class com.google.common.collect.AbstractIterator

  `endOfData, hasNext, next, peek`

  ### Methods inherited from class com.google.common.collect.UnmodifiableIterator

  `remove`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.util.Iterator

  `forEachRemaining, hasNext, next, remove`

- ## Constructor Details

  - ### IteratorAsQueryResult

    public IteratorAsQueryResult(CloseableIterator<T> theIter, Runnable theOnClose, Runnable theOnSuccess)

  - ### IteratorAsQueryResult

    public IteratorAsQueryResult(CloseableIterator<T> theIter, Runnable theOnClose, Runnable theOnSuccess, Function<Exception,RuntimeException> theOnError)

- ## Method Details

  - ### close

    public void close() throws QueryExecutionFailure
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `CloseableIterator<T>`
    Throws:
      `QueryExecutionFailure`

  - ### computeNext

    protected T computeNext()
    Specified by:
      `computeNext` in class `com.google.common.collect.AbstractIterator<T>`