T - the source element typepublic static class Windowing.WithTime<T> extends java.lang.Object implements Observable<Observable<T>>
The implementation ensures that if timespan and timeshift are equal, the windows won't overlap.
| Modifier and Type | Field and Description |
|---|---|
protected Scheduler |
pool |
protected Observable<? extends T> |
source |
protected long |
timeshift |
protected long |
timespan |
protected java.util.concurrent.TimeUnit |
unit |
| Constructor and Description |
|---|
WithTime(Observable<? extends T> source,
long timespan,
long timeshift,
java.util.concurrent.TimeUnit unit,
Scheduler pool)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.io.Closeable |
exactWindow(Observer<? super Observable<T>> observer)
Create windows by an exact timing.
|
protected java.io.Closeable |
generalWindow(Observer<? super Observable<T>> observer)
Create a general windowing operation.
|
java.io.Closeable |
register(Observer<? super Observable<T>> observer)
Registers an observer for the notification of Ts.
|
protected final Observable<? extends T> source
protected final long timespan
protected final long timeshift
protected final java.util.concurrent.TimeUnit unit
protected final Scheduler pool
public WithTime(Observable<? extends T> source, long timespan, long timeshift, java.util.concurrent.TimeUnit unit, Scheduler pool)
source - the source sequencetimespan - the length of each windowtimeshift - the interval between the creation of consequtive windowsunit - the time unitpool - the scheduler for the timed oeprations@Nonnull public java.io.Closeable register(Observer<? super Observable<T>> observer)
Observableregister in interface Observable<Observable<T>>observer - the observer of Ts or any supertype of itprotected java.io.Closeable exactWindow(Observer<? super Observable<T>> observer)
observer - the observerprotected java.io.Closeable generalWindow(Observer<? super Observable<T>> observer)
observer - the output observer