Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
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)