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

JCasUtil methods could be more generic

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.0uimaFIT
    • Component/s: uimaFIT
    • Labels:
      None

      Description

      As an example, the method indexCovering of JCasUtil has signature:

      public static <T extends Annotation,S extends Annotation> Map<T, Collection<S>> indexCovering(
        JCas jCas,
        Class<T> type,
        Class<S> coveringType)
      

      With this signature, the following code is invalid (RevisedSentence is a subclass of Sentence):

      Map<RevisedWords, Collection<Sentence>> indexRevised
                      = JCasUtil.indexCovering(
                              revised,
                              RevisedWords.class,
                              RevisedSentence.class);
      

      This somewhat prevents users of JCasUtil from benefiting of all the OOP pluses of the UIMA TS.

      Here would be a signature that would maybe better fit the problem:

      public static <T extends Annotation, S extends Annotation> Map<T, Collection<S>> indexCovering(
        JCas jCas,
        Class<? extends T> type,
        Class<? extends S> coveringType)
      

        Attachments

          Activity

            People

            • Assignee:
              rec Richard Eckart de Castilho
              Reporter:
              m09 Hugo Mougard
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: