/** * Returns a reactive value which is false when this collection is empty, true otherwise. */ public ValueView<Boolean> isNonEmptyView () { return sizeView().map(Functions.greaterThan(0)); }
/** * Returns whether this image is successfully loaded. If it is still loading, or loading failed, * {@code false} will be returned. In general you'll want to react to {@link #state}, but this * method is useful when you need to assert that something is only allowed on a fully loaded * image. */ public boolean isLoaded () { Try<Image> cur = state.result(); return cur != null && cur.isSuccess(); }
@Override protected void connectionRemoved () { super.connectionRemoved(); if (!hasConnections() && _conn != null) { _conn.close(); _conn = null; } }
/** Causes {@code slot} to be notified when this future is completed. If it has already * completed, the slot will be notified immediately. * @return this future for chaining. */ public RFuture<T> onComplete (final SignalView.Listener<? super Try<T>> slot) { Try<T> result = result(); if (result != null) slot.onEmit(result); else addConnection(slot); return this; }
/** * Returns a reactive value which is true when this collection is empty, false otherwise. */ public ValueView<Boolean> isEmptyView () { return sizeView().map(Functions.lessThanEqual(0)); }
@Override protected void disconnect () { super.disconnect(); if (conn != null) conn.close(); } };
@Override protected void connectionRemoved () { super.connectionRemoved(); if (!hasConnections()) disconnect(); }
@Override protected void connectionAdded () { super.connectionAdded(); if (_conn == null) _conn = connect(); }
@Override protected void notify (Notifier notifier, Object a1, Object a2, Object a3) { try { super.notify(notifier, a1, a2, a3); } finally { updateSize(); } }
public void run () { _listeners = Cons.remove(_listeners, cons); connectionRemoved(); } });
/** * Returns whether this image is successfully loaded. If it is still loading, or loading failed, * {@code false} will be returned. In general you'll want to react to {@link #state}, but this * method is useful when you need to assert that something is only allowed on a fully loaded * image. */ public boolean isLoaded () { Try<Image> cur = state.result(); return cur != null && cur.isSuccess(); }
@Override protected void connectionRemoved () { super.connectionRemoved(); if (!hasConnections() && _conn != null) { _conn.close(); _conn = null; } }
/** * Returns a reactive value which is true when this collection is empty, false otherwise. */ public ValueView<Boolean> isEmptyView () { return sizeView().map(Functions.lessThanEqual(0)); }