我收到此行的编译器错误:
Collections.sort(terms, new QuerySorter_TFmaxIDF(myInteger));
我的自定义比较器非常基础;这是签名和构造函数:
public class QuerySorter_TFmaxIDF implements Comparator<Term>{
private int numberOfDocs;
QuerySorter_TFmaxIDF(int n){
super();
numberOfDocs = n;
}
}
是否因为我将参数传递给比较器而出现错误?我需要通过一个论点...