org.reactfx.MappedStream 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;
import java.util.concurrent.CompletionStage;
import java.util.function.Function;
import javafx.concurrent.Task;
/**
* See {@link EventStream#map(Function)}
*/
class MappedStream extends EventStreamBase {
private final EventStream input;
private final Function super T, ? extends U> f;
public MappedStream(
EventStream input,
Function super T, ? extends U> f) {
this.input = input;
this.f = f;
}
@Override
protected Subscription observeInputs() {
return input.subscribe(value -> {
emit(f.apply(value));
});
}
}
class MappedToCompletionStageStream
extends MappedStream>
implements CompletionStageStream {
public MappedToCompletionStageStream(
EventStream input,
Function super T, CompletionStage> f) {
super(input, f);
}
}
class MappedToTaskStream
extends MappedStream>
implements TaskStream {
public MappedToTaskStream(
EventStream input,
Function super T, Task> f) {
super(input, f);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy