A
CollectionReader
is used to iterate over the elements of a Collection. Iteration is done using the {@link #hasNext()} and {@link #getNext(CAS)} methods. Each element of thecollection is returned in a {@link CAS}.
A consuming CollectionReader
is one that removes each element from the collection as it is read. To find out whether a CollectionReader
will consume elements in this way, call the {@link #isConsuming()} method.
Users of a CollectionReader
should always {@link #close() close} it when they arefinished using it.
CollectionReader
s are also {@link ConfigurableResource}s, and can be instantiated from descriptors. See {@link org.apache.uima.util.XMLParser#parseCollectionReaderDescription(XMLInputSource)} and{@link org.apache.uima.UIMAFramework#produceCollectionReader(ResourceSpecifier,Map)} for moreinformation.