You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by Jörn Kottmann <ko...@gmail.com> on 2009/08/24 12:55:18 UTC

generics: JFSIndexRepository

public interface JFSIndexRepository {

  FSIndex<TOP> getIndex(String label);
  FSIndex<TOP> getIndex(String label, int type);
  AnnotationIndex<Annotation> getAnnotationIndex();
  AnnotationIndex<Annotation> getAnnotationIndex(int type);
  Iterator<FSIndex<Top>> getIndexes();
  FSIterator<TOP> getAllIndexedFS(Type aType);
  FSIterator<TOP> getAllIndexedFS(int aType);
}

Is the above generification correct ?

We could use FeatureStructure instead of TOP, I am not sure
whats better.

Jörn

Re: generics: JFSIndexRepository

Posted by Adam Lally <al...@alum.rpi.edu>.
On Mon, Aug 24, 2009 at 6:55 AM, Jörn Kottmann<ko...@gmail.com> wrote:
> public interface JFSIndexRepository {
>
>  FSIndex<TOP> getIndex(String label);
>  FSIndex<TOP> getIndex(String label, int type);
>  AnnotationIndex<Annotation> getAnnotationIndex();
>  AnnotationIndex<Annotation> getAnnotationIndex(int type);
>  Iterator<FSIndex<Top>> getIndexes();
>  FSIterator<TOP> getAllIndexedFS(Type aType);
>  FSIterator<TOP> getAllIndexedFS(int aType);
> }
>
> Is the above generification correct ?
>
> We could use FeatureStructure instead of TOP, I am not sure
> whats better.
>

Seems to me that TOP is better for JCAS, just like Annotation is
better than AnnotationFS.
  -Adam

Re: generics: JFSIndexRepository

Posted by Marshall Schor <ms...@schor.com>.

Jörn Kottmann wrote:
> public interface JFSIndexRepository {
>
>  FSIndex<TOP> getIndex(String label);
>  FSIndex<TOP> getIndex(String label, int type);
>  AnnotationIndex<Annotation> getAnnotationIndex();
>  AnnotationIndex<Annotation> getAnnotationIndex(int type);
>  Iterator<FSIndex<Top>> getIndexes();
>  FSIterator<TOP> getAllIndexedFS(Type aType);
>  FSIterator<TOP> getAllIndexedFS(int aType);
> }
>
> Is the above generification correct ?
>
> We could use FeatureStructure instead of TOP, I am not sure
> whats better.
I think the generification is correct, because TOP is the JCas version
of the FeatureStructure interface. 

Another note (http://markmail.org/thread/pafkl3luotd3wkfr - toward the
bottom of the thread) suggests additional methods that pass in a class
instance, and then use that to specify the returned type.

-Marshall
>


>
> Jörn
>
>