com.r3corda.client.fxutils / AssociatedList

AssociatedList

class AssociatedList<K, out A, B> : ReadOnlyBackedObservableMapBase<K, B, Unit>

AssociatedList creates an ObservableMap from an ObservableList by associating each list element with a unique key. It is not allowed to have several elements map to the same value

Parameters

sourceList - The source list.

toKey - Function returning the key.

assemble - The function to assemble the final map element from the list element and the associated key.


Constructors

<init> AssociatedList(sourceList: ObservableList<out A>, toKey: (A) -> K, assemble: (K, A) -> B)

AssociatedList creates an ObservableMap from an ObservableList by associating each list element with a unique key. It is not allowed to have several elements map to the same value

Properties

sourceList val sourceList: ObservableList<out A>

Inherited Properties

backingMap val backingMap: HashMap<K, <ERROR CLASS><A, B>>
entries open val entries: MutableSet<MutableEntry<K, A>>
keys open val keys: MutableSet<K>
size open val size: Int
values open val values: MutableCollection<A>

Inherited Functions

addListener open fun addListener(listener: InvalidationListener): Unit
clear open fun clear(): Unit
isEmpty open fun isEmpty(): Boolean
removeListener open fun removeListener(listener: InvalidationListener?): Unit

Extension Functions

createMapChange fun <A, K> ObservableMap<K, A>.createMapChange(key: K, removedValue: A?, addedValue: A?): Change<K, A>
getObservableEntries fun <K, V> ObservableMap<K, V>.getObservableEntries(): ObservableList<Entry<K, V>>

val nameToPerson: ObservableMap<String, Person> = (..) val people: ObservableList = nameToPerson.getObservableValues()

getObservableValue fun <K, V> ObservableMap<K, V>.getObservableValue(key: K): ObservableValue<V?>

val nameToPerson: ObservableMap<String, Person> = (..) val john: ObservableValue<Person?> = nameToPerson.getObservableValue("John")

getObservableValues fun <K, V> ObservableMap<K, V>.getObservableValues(): ObservableList<V>

val nameToPerson: ObservableMap<String, Person> = (..) val people: ObservableList = nameToPerson.getObservableValues()