Class ExceptionConvertingIteration<E,​X extends java.lang.Exception>

  • All Implemented Interfaces:
    java.lang.AutoCloseable, CloseableIteration<E,​X>, Iteration<E,​X>
    Direct Known Subclasses:
    SailCloseableIteration

    @Deprecated(since="4.1.0")
    public abstract class ExceptionConvertingIteration<E,​X extends java.lang.Exception>
    extends AbstractCloseableIteration<E,​X>
    Deprecated.
    A CloseableIteration that converts an arbitrary iteration to an iteration with exceptions of type X. Subclasses need to override convert(Exception) to do the conversion.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Iteration<? extends E,​? extends java.lang.Exception> iter
      Deprecated.
      The underlying Iteration.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ExceptionConvertingIteration​(Iteration<? extends E,​? extends java.lang.Exception> iter)
      Deprecated.
      Creates a new ExceptionConvertingIteration that operates on the supplied iteration.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected abstract X convert​(java.lang.Exception e)
      Deprecated.
      Converts an exception from the underlying iteration to an exception of type X.
      protected void handleClose()
      Deprecated.
      Closes this Iteration as well as the wrapped Iteration if it happens to be a CloseableIteration .
      boolean hasNext()
      Deprecated.
      Checks whether the underlying Iteration contains more elements.
      E next()
      Deprecated.
      Returns the next element from the wrapped Iteration.
      void remove()
      Deprecated.
      Calls remove() on the underlying Iteration.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • iter

        private final Iteration<? extends E,​? extends java.lang.Exception> iter
        Deprecated.
        The underlying Iteration.
    • Constructor Detail

      • ExceptionConvertingIteration

        protected ExceptionConvertingIteration​(Iteration<? extends E,​? extends java.lang.Exception> iter)
        Deprecated.
        Creates a new ExceptionConvertingIteration that operates on the supplied iteration.
        Parameters:
        iter - The Iteration that this ExceptionConvertingIteration operates on, must not be null.
    • Method Detail

      • convert

        protected abstract X convert​(java.lang.Exception e)
        Deprecated.
        Converts an exception from the underlying iteration to an exception of type X.
      • hasNext

        public boolean hasNext()
                        throws X extends java.lang.Exception
        Deprecated.
        Checks whether the underlying Iteration contains more elements.
        Returns:
        true if the underlying Iteration contains more elements, false otherwise.
        Throws:
        X
        X
        X extends java.lang.Exception
      • next

        public E next()
               throws X extends java.lang.Exception
        Deprecated.
        Returns the next element from the wrapped Iteration.
        Returns:
        the next element in the iteration.
        Throws:
        X
        java.util.NoSuchElementException - If all elements have been returned.
        java.lang.IllegalStateException - If the Iteration has been closed.
        X extends java.lang.Exception
      • remove

        public void remove()
                    throws X extends java.lang.Exception
        Deprecated.
        Calls remove() on the underlying Iteration.
        Throws:
        java.lang.UnsupportedOperationException - If the wrapped Iteration does not support the remove operation.
        java.lang.IllegalStateException - If the Iteration has been closed, or if next() has not yet been called, or remove() has already been called after the last call to next().
        X extends java.lang.Exception
      • handleClose

        protected void handleClose()
                            throws X extends java.lang.Exception
        Deprecated.
        Closes this Iteration as well as the wrapped Iteration if it happens to be a CloseableIteration .
        Overrides:
        handleClose in class AbstractCloseableIteration<E,​X extends java.lang.Exception>
        Throws:
        X
        X extends java.lang.Exception