Re: generics: AnalysisComponent.getRequiredCasInterface();

2009-08-19 Thread Marshall Schor


Jörn Kottmann wrote:
> Is that the correct generification?
> Class getRequiredCasInterface();
>
> Implementing classes can then specify the concrete return
> type.
>
> For example:
> Class JCasAnnotator_ImplBase.getRequiredCasInterface()
> Class CasAnnotator_ImplBase.getRequiredCasInterface()
I tried:
  public static void tgrci(AnalysisComponent ac) {
Class x = ac.getRequiredCasInterface();
  }

but it doesn't work, gives error:
// error, cannot convert from Class
to Class

This is with the interface AnalysisComponent defining
getRequiredCasInterface as:
 Class getRequiredCasInterface();

This works:
  public static void tgrci(AnalysisComponent ac) {
Class x = ac.getRequiredCasInterface();
  }

and this works too:
  public static void tgrci(AnalysisComponent ac) {
Class x = ((JCasAnnotator_ImplBase)ac).getRequiredCasInterface();
  }

So, I think we have the correct generification in the interface
AnalysisComponent, of return .

-Marshall.

> Jörn
>
>
>


generics: AnalysisComponent.getRequiredCasInterface();

2009-08-19 Thread Jörn Kottmann

Is that the correct generification?
Class getRequiredCasInterface();

Implementing classes can then specify the concrete return
type.

For example:
Class JCasAnnotator_ImplBase.getRequiredCasInterface()
Class CasAnnotator_ImplBase.getRequiredCasInterface()

Jörn