Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-2830

Expose FSIterator via (J)CasUtil.select*() methods where applicable

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: uimaFIT
    • Labels:
      None

      Description

      Some of the uimaFIT (J)CasUtil "select" methods work directly on an FSIndex or FSIterator. In those cases, it would be nice if the methods didn't just return a Collection, but some FSCollection<T> in which the iterator() method returns an FSIterator<T>.

      At least in those cases were an AnnotationIndex is used, it would be possible to actually return something that implements Collection<T> and FSIndex<T>, so it can be used in constructors like new ArrayList(...), in modern-style for loops, and for type-save access to the index.

      In those cases were an FSIterator is used because the type searched for is not an annotation, the FSIndex<T> interface is not a good choice, because it contains several methods that cannot be implemented based only on FSIterator.

      So maybe two interfaces: FSCollection<T> based on FSIterator and AnnotationCollection<T> based on FSIndex/AnnotationIndex.

      This mainly exposes more details of UIMA AnnotationIndex via CasUtil. JCasUtil's select method doesn't make a different between FSes that inherit from AnnotationFS or not. Here, the only benefit is getting access to an FSIterator.

        Attachments

          Activity

            People

            • Assignee:
              rec Richard Eckart de Castilho
              Reporter:
              rec Richard Eckart de Castilho
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: