【发布时间】:2014-11-17 08:07:27
【问题描述】:
在介绍 EasyBind 之前 -
DoubleBinding contentHeight = Bindings.createDoubleBinding(
() -> getHeight() - getInsets().getTop() - getInsets().getBottom(),
heightProperty(), insetsProperty());
引入 EasyBind 之后 -
Binding<Double> contentHeight = EasyBind.combine(
heightProperty(), insetsProperty(),
(h, i) -> h.doubleValue() - i.getTop() - i.getBottom());
我对@987654323@ 部分感到有些不自在。每次我combine NumberProperty 的某个子类时,EasyBind 都会传递 Number 而不是 Double、Integer、...
有什么办法可以避免doubleValue()?
【问题讨论】: