@Override public void dispose() { binding.dispose(); }
/** * Removes a {@link Binding} from this {@code CompositeBinding}, and disposes the * {@link Binding}. * * @param b the {@link Binding} to remove */ public void remove(final Binding b) { if (!disposedInd) { boolean unsubscribe = false; if (bindings == null) { return; } unsubscribe = bindings.remove(b); if (unsubscribe) { // if we removed successfully we then need to call dispose on it b.dispose(); } } }
/** * Removes a {@link Binding} from this {@code CompositeBinding}, and disposes the * {@link Binding}. * * @param b the {@link Binding} to remove */ public void remove(final Binding b) { if (!disposedInd) { boolean unsubscribe = false; if (bindings == null) { return; } unsubscribe = bindings.remove(b); if (unsubscribe) { // if we removed successfully we then need to call dispose on it b.dispose(); } } }
/** * Adds a new {@link Binding} to this {@code CompositeBinding} if the * {@code CompositeBinding} is not yet disposedInd. If the {@code CompositeBinding} <em>is</em> * disposed, {@code add} will indicate this by explicitly disposing the new {@code Binding} as * well. * * @param b the {@link Binding} to add */ public void add(final Binding b) { if (!disposedInd) { if (bindings == null) { bindings = new HashSet<>(4); } bindings.add(b); return; } b.dispose(); }
/** * Adds a new {@link Binding} to this {@code CompositeBinding} if the * {@code CompositeBinding} is not yet disposedInd. If the {@code CompositeBinding} <em>is</em> * disposed, {@code add} will indicate this by explicitly disposing the new {@code Binding} as * well. * * @param b the {@link Binding} to add */ public void add(final Binding b) { if (!disposedInd) { if (bindings == null) { bindings = new HashSet<>(4); } bindings.add(b); return; } b.dispose(); }
private static void unsubscribeFromAll(Collection<Binding> bindings) { if (bindings == null) { return; } List<Throwable> es = null; for (Binding b : bindings) { try { b.dispose(); } catch (Throwable e) { if (es == null) { es = new ArrayList<>(); } es.add(e); } } if (es != null) es.forEach(Exceptions::throwIfFatal); }
private static void unsubscribeFromAll(Collection<Binding> bindings) { if (bindings == null) { return; } List<Throwable> es = null; for (Binding b : bindings) { try { b.dispose(); } catch (Throwable e) { if (es == null) { es = new ArrayList<>(); } es.add(e); } } if (es != null) es.forEach(Exceptions::throwIfFatal); }
@Override public void dispose() { getDelegate().dispose(); }