Logo Search packages:      
Sourcecode: uimaj version File versions  Download package

Public Member Functions | Package Functions

org::apache::uima::cas::FSIterator< T extends FeatureStructure > Interface Reference

Inheritance diagram for org::apache::uima::cas::FSIterator< T extends FeatureStructure >:
Inheritance graph
Collaboration diagram for org::apache::uima::cas::FSIterator< T extends FeatureStructure >:
Collaboration graph

List of all members.

Public Member Functions

FSIterator< T > copy ()
get () throws NoSuchElementException
void moveTo (FeatureStructure fs)
void moveToFirst ()
void moveToLast ()
void moveToNext ()
void moveToPrevious ()

Package Functions

boolean isValid ()

Detailed Description

Iterator over feature structures.

This iterator interface extends java.util.Iterator, and supports the standard hasNext and next methods. If finer control, including reverse iteration, is needed, see below.

Note: do not use the APIs described below *together* with the standard Java iterator methods next() and hasNext(). On any given iterator, use either the one or the other, but not both together. Otherwise, next/hasNext may exhibit incorrect behavior.

The FSIterator interface introduces the methods get(), moveToNext(), moveToPrevious() methods. With these methods, retrieving the current element (get) is a separate operation from moving the iterator (moveToNext and moveToPrevious. This makes the user's code less compact, but allows for finer control.

Specifically the get method is defined to return the same element that a call to next() would return, but does not advance the iterator.

Implementations of this interface are not required to be fail-fast. That is, if the iterator's collection is modified, the effects on the iterator are in general undefined. Some collections may handle this more gracefully than others, but in general, concurrent modification of the collection you're iterating over is a bad idea.

If the iterator is moved past the boundaries of the collection, the behavior of subsequent calls to moveToNext() or moveToPrevious() is undefined. For example, if a previously valid iterator is invalidated by a call to moveToNext(), a subsequent call to moveToPrevious() is not guaranteed to set the iterator back to the last element in the collection. Always use moveToLast() in such cases.

Definition at line 67 of file FSIterator.java.

The documentation for this interface was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index