org.apache.uima.analysis_engine

## Interface CasIterator

- All Known Implementing Classes:
    EmptyCasIterator

      public interface CasIterator

  An iterator over a collection of CASes. One use for this interface is to allow an application to iterate over all of the CASes produced by as output of the `AnalysisEngine.processAndOutputNewCASes(CAS)` method.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasNext()` Checks if there are more CASes to be returned by the iterator.
    `CAS` | `next()` Gets the next CAS from the iterator.
    `void` | `release()` Releases any CASes owned by this CasIterator.

- - ### Method Detail

    - #### hasNext

          boolean hasNext()
                   throws AnalysisEngineProcessException

      Checks if there are more CASes to be returned by the iterator.
      Returns:
        true if there are more CASes to be returned, false if not
      Throws:
        `AnalysisEngineProcessException` - if a failure has occurred during processing. If an exception is thrown, this indicates that processing has aborted, so no further calls to the CasIterator should be made.

    - #### next

          CAS next()
            throws AnalysisEngineProcessException

      Gets the next CAS from the iterator.
      Returns:
        the next CAS.
      Throws:
        `AnalysisEngineProcessException` - if a failure has occurred during processing. If an exception is thrown, this indicates that processing has aborted, so no further calls to the CasIterator should be made.

    - #### release

          void release()

      Releases any CASes owned by this CasIterator. You only need to Call this method if you stop using a CasIterator before you have iterated all the way through.

Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.