0

我有一个实现的类,callable我希望可调用类只返回一个类型的对象Mat。我将 Future 列表声明如下:

    private static Future<List<Mat>> fiConspFutureList = null;
    fiConspFutureList = new Future<List<Mat>>();//Cannot instantiate the type Future<List<Mat>>

但我收到Cannot instantiate the type Future<List<Mat>>

请让我知道我做错了什么?

代码

static class FIConspMap implements Callable<Mat> {

    private Mat fiOnOffMap = null;
    private Mat fiOffOnMap = null;
    private ConspicuityMap fiConspMap = null;

    public FIConspMap() throws InterruptedException, ExecutionException {
        // TODO Auto-generated constructor stub
        this.fiOnOffMap = fiCompFutureList.get(0).get().get(0);
        this.fiOffOnMap = fiCompFutureList.get(0).get().get(1);
        this.fiConspMap = new ConspicuityMap(this.fiOnOffMap, this.fiOffOnMap, SysConsts.FI_TOKEN);
    }

    public Mat call() throws Exception {
        // TODO Auto-generated method stub
        return fiConspMap.getConspicuityMap();// here i want to return only an object of type Mat
    }

}
4

0 回答 0