Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/315.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
“热到”;“展平”;TornadFX(JavaFX扩展)中ObjectProperty的ObjectProperty?_Java_Javafx_Kotlin_Tornadofx - Fatal编程技术网

“热到”;“展平”;TornadFX(JavaFX扩展)中ObjectProperty的ObjectProperty?

“热到”;“展平”;TornadFX(JavaFX扩展)中ObjectProperty的ObjectProperty?,java,javafx,kotlin,tornadofx,Java,Javafx,Kotlin,Tornadofx,假设我有三门课: class A { val bProperty: ObjectProperty<B> = SimpleObjectProperty(B(C("test"))) val cObservable: ObservableValue<C> = ??? } class B(initialC: C) { val cProperty: ObjectProperty<C> = SimpleObjectProperty(initia

假设我有三门课:

class A {
    val bProperty: ObjectProperty<B> = SimpleObjectProperty(B(C("test")))

    val cObservable: ObservableValue<C> = ???
}

class B(initialC: C) {
    val cProperty: ObjectProperty<C> = SimpleObjectProperty(initialC)
}

class C(val string: String)
但这给了我一个
ObservableValue
ObservableValue
C
ObservableValue
。所以这不是我能处理的


提前感谢您的帮助。

您可以使用
选择
扩展方法:

val cObservable: ObservableValue<C> = bProperty.select { it.cProperty }
val cObservable:observeValue=bProperty.select{it.cProperty}
或:

val cObservable:observeValue=bProperty.select(B::cProperty)
val cObservable: ObservableValue<C> = bProperty.select { it.cProperty }
val cObservable: ObservableValue<C> = bProperty.select (B::cProperty)