@Override protected Connection connect () { return outer.connect(new Listener<T>() { @Override public void onChange (T value, T ovalue) { notifyChange(func.apply(value), func.apply(ovalue)); } }); } };
@Override protected Connection connect () { return outer.connect(new Listener<T>() { @Override public void onChange (T value, T ovalue) { notifyChange(func.apply(value), func.apply(ovalue)); } }); } };
@Override public Connection connect (Slot<? super T> slot) { return connect((Listener<? super T>)slot); } @Override public Connection connectNotify (Slot<? super T> slot) {
@Override protected Connection connect () { return outer.connect(new ValueView.Listener<T>() { @Override public void onChange (T value, T oldValue) { notifyEmit(value); } }); } };
@Override protected Connection connect () { return outer.connect(new ValueView.Listener<T>() { @Override public void onChange (T value, T oldValue) { notifyEmit(value); } }); } };
@Override public Connection connect (Slot<? super T> slot) { return connect((Listener<? super T>)slot); } @Override public Connection connectNotify (Slot<? super T> slot) {
@Override public Connection connect (SignalView.Listener<? super T> listener) { return connect(wrap(listener)); } @Override public Connection connectNotify (SignalView.Listener<? super T> listener) {
@Override public Connection connect (SignalView.Listener<? super T> listener) { return connect(wrap(listener)); } @Override public Connection connectNotify (SignalView.Listener<? super T> listener) {
@Override public Connection connectNotify (Listener<? super T> listener) { // connect before calling emit; if the listener changes the value in the body of onEmit, it // will expect to be notified of that change; however if onEmit throws a runtime exception, // we need to take care of disconnecting the listener because the returned connection // instance will never reach the caller Connection conn = connect(listener); try { listener.onChange(get(), null); return conn; } catch (RuntimeException re) { conn.close(); throw re; } catch (Error e) { conn.close(); throw e; } }
@Override public Connection connectNotify (Listener<? super T> listener) { // connect before calling emit; if the listener changes the value in the body of onEmit, it // will expect to be notified of that change; however if onEmit throws a runtime exception, // we need to take care of disconnecting the listener because the returned connection // instance will never reach the caller Connection conn = connect(listener); try { listener.onChange(get(), null); return conn; } catch (RuntimeException re) { conn.close(); throw re; } catch (Error e) { conn.close(); throw e; } }