0
getNodes()
メソッドでエラーが発生します。 ***抽象型のリストビューでメソッドを呼び出す方法
The method getfilter(ListView<CellObject>) in the type NodeUtil is not
applicable for the arguments (ListView<Index>)
しかしIndex
がCellObject
を実装し、Employee
はIndex
を拡張するので、それが動作するはず?あなたが特定の型または型そのextends
特定のタイプをしたい場合は、この使用、指定する必要がジェネリックで
public abstract class Index implements CellObject {
}
..
@FXML private ListView <Index> listView;
public List<Node> getNodes() {
List<Node> nodes = new ArrayList<>();
***nodes.add(NodeUtil.getfilter(listView));***
return nodes;
}
public class Employee extends Index {
@Override
public String getInfo() {
return name + address;
}
}
public abstract class NodeUtil {
public static List <Node> getfilter(ListView <CellObject> lv) {
...
lv.getItems().stream()
.filter(c -> c.getInfo().contains("xxx"))
...
}
}
を私はそれはのようなものだと思います'ListView <? CellObject> ' –
https://stackoverflow.com/questions/2723397/what-is-pecs-producer-extends-consumer-super –