org.reactfx.value.SuspendableValWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of richtextfx Show documentation
Show all versions of richtextfx Show documentation
FX-Text-Area for formatted text and other special effects.
package org.reactfx.value;
import java.util.function.Consumer;
import org.reactfx.SuspendableBase;
import org.reactfx.util.AccumulatorSize;
import org.reactfx.util.NotificationAccumulator;
class SuspendableValWrapper
extends SuspendableBase, T, T>
implements SuspendableVal, ProperVal {
private final Val delegate;
protected SuspendableValWrapper(Val obs) {
super(
obs.invalidations(),
NotificationAccumulator.retainOldestValNotifications());
this.delegate = obs;
}
@Override
public T getValue() {
return delegate.getValue();
}
@Override
protected AccumulatorSize sizeOf(T accum) {
return AccumulatorSize.ONE;
}
@Override
protected T headOf(T accum) {
return accum;
}
@Override
protected T tailOf(T accum) {
throw new UnsupportedOperationException("Cannot take a tail of a single value");
}
}