i has the following interface:
public interface Evaluator<T> { T evaluate(Collection<Extractable> sample); }
And a class that implements this interface:
public class PrecisionEvaluator implements Evaluator<Map<Triple<Short, Integer, String>, AttributePrecisionBean>> { @Override public Map<Triple<Short, Integer, String>, AttributePrecisionBean> evaluate(Collection<Extractable> sample){ ...
}
so using the above will be:
Evaluator<Map<Triple<Short, Integer, String>, AttributePrecisionBean>> eval = new PrecisionEvaluator();
Is there a way to make the Evaluator interface implicitly return the generic type defined in the class that implements it? so using will be simple:
Evaluator eval = new PrecisionEvaluator();
Or is there a cleaner way to do this?
source share