corda / net.corda.client.jfx.utils / FlattenedList / WrappedObservableValue / <init>

# <init>

`WrappedObservableValue(observableValue: ObservableValue<A>)`

We maintain an ObservableValue->index map. This is needed because we need the ObservableValue's index in order to propagate a change and if the listener closure captures the index at the time of the call to ObservableValue.addListener it will become incorrect if the indices shift around later.

Note that because of the bookkeeping required for this map, any remove operation and any add operation that inserts to the middle of the list will be O(N) as we need to scan the map and shift indices accordingly.

Note also that we're wrapping each ObservableValue, this is required because we want to support reusing of ObservableValues and we need each to have a different hash.