com.r3corda.client.fxutils / FlattenedList / WrappedObservableValue / <init>

# <init>

`WrappedObservableValue(observableValue: ObservableValue<A>)`

We maintain an ObservableValue->index map. This is needed because we need the ObservableValues 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 were wrapping each ObservableValue, this is required because we want to support reusing of ObservableValues and we need each to have a different hash.