public abstract class Windowing extends Object
| Constructor and Description |
|---|
Windowing() |
| Modifier and Type | Method and Description |
|---|---|
static <T> Iterator<List<Optional<T>>> |
centered(int windowSize,
Iterable<T> iterable)
Adapts an iterable to an iterator showing a sliding centered window of
the contained elements.
|
static <W extends Collection<Optional<T>>,T> |
centered(int windowSize,
Iterable<T> iterable,
Supplier<W> supplier)
Adapts an iterable to an iterator showing a sliding centered window of
the contained elements.
|
static <T> Iterator<List<Optional<T>>> |
centered(int windowSize,
Iterator<T> iterator)
Adapts an iterator to an iterator showing a sliding centered window of
the contained elements.
|
static <W extends Collection<Optional<T>>,T> |
centered(int windowSize,
Iterator<T> iterator,
Supplier<W> supplier)
Adapts an iterator to an iterator showing a sliding centered window of
the contained elements.
|
static <T> Iterator<Queue<Optional<T>>> |
trails(int trailSize,
Iterable<T> iterable)
Adapts an iterator to an iterator showing predecessors of the contained
elements.
|
static <T,W extends Collection<?>> |
trails(int trailSize,
Iterable<T> iterable,
Function<Queue<Optional<T>>,W> copy)
Adapts an iterator to an iterator showing predecessors of the contained
elements.
|
static <T> Iterator<Queue<Optional<T>>> |
trails(int trailSize,
Iterator<T> iterator)
Adapts an iterator to an iterator showing predecessors of the contained
elements.
|
static <T,W extends Collection<?>> |
trails(int trailSize,
Iterator<T> iterator,
Function<Queue<Optional<T>>,W> copy)
Adapts an iterator to an iterator showing predecessors of the contained
elements.
|
static <T> Iterator<List<T>> |
window(int windowSize,
Iterable<T> iterable)
Adapts an iterable to an iterator showing a sliding window of the
contained elements.
|
static <W extends Collection<T>,T> |
window(int windowSize,
Iterable<T> iterable,
Supplier<W> supplier)
Adapts an iterable to an iterator showing a sliding window of the
contained elements.
|
static <T> Iterator<List<T>> |
window(int windowSize,
Iterator<T> iterator)
Adapts an iterator to an iterator showing a sliding window of the
contained elements.
|
static <W extends Collection<T>,T> |
window(int windowSize,
Iterator<T> iterator,
Supplier<W> supplier)
Adapts an iterator to an iterator showing a sliding window of the
contained elements.
|
public static <T> Iterator<List<T>> window(int windowSize, Iterator<T> iterator)
T - the iterator element typewindowSize - the window sizeiterator - the iterator to be adaptedpublic static <T> Iterator<List<T>> window(int windowSize, Iterable<T> iterable)
T - the iterator element typewindowSize - the window sizeiterable - the iterable to be adaptedpublic static <W extends Collection<T>,T> Iterator<W> window(int windowSize, Iterator<T> iterator, Supplier<W> supplier)
W - the window typeT - the iterator element typewindowSize - the window sizeiterator - the iterable to be adaptedsupplier - the supplier providing the window collectionpublic static <W extends Collection<T>,T> Iterator<W> window(int windowSize, Iterable<T> iterable, Supplier<W> supplier)
W - the window typeT - the iterator element typewindowSize - the window sizeiterable - the iterable to be adaptedsupplier - the supplier providing the window collectionpublic static <T> Iterator<List<Optional<T>>> centered(int windowSize, Iterator<T> iterator)
T - the iterator element typewindowSize - the window size (must be an odd positive integer)iterator - the iterator to be adaptedpublic static <T> Iterator<List<Optional<T>>> centered(int windowSize, Iterable<T> iterable)
T - the iterator element typewindowSize - the window size (must be an odd positive integer)iterable - the iterable to be adaptedpublic static <W extends Collection<Optional<T>>,T> Iterator<W> centered(int windowSize, Iterator<T> iterator, Supplier<W> supplier)
W - the window typeT - the iterator element typewindowSize - the window size (must be an odd positive integer)iterator - the iterator to be adaptedsupplier - the supplier providing the window collectionpublic static <W extends Collection<Optional<T>>,T> Iterator<W> centered(int windowSize, Iterable<T> iterable, Supplier<W> supplier)
W - the window typeT - the iterator element typewindowSize - the window size (must be an odd positive integer)iterable - the iterable to be adaptedsupplier - the supplier providing the window collectionpublic static <T> Iterator<Queue<Optional<T>>> trails(int trailSize, Iterator<T> iterator)
iterator: [1,2,3,4], trailSize: 3 ->
[[Nothing, Nothing, Just 1],[Nothing Just 1, Just 2], [Just 1, Just 2, Just 3], [Just 2, Just 3, Just 4]]
T - the adapted iterator element typetrailSize - the trail sizeiterator - the iterator to be adaptedpublic static <T,W extends Collection<?>> Iterator<W> trails(int trailSize, Iterator<T> iterator, Function<Queue<Optional<T>>,W> copy)
iterator: [1,2,3,4], trailSize: 3 ->
[[Nothing, Nothing, Just 1],[Nothing Just 1, Just 2], [Just 1, Just 2, Just 3], [Just 2, Just 3, Just 4]]
T - the adapted iterator element typeW - the window typetrailSize - the trail sizeiterator - the iterator to be adaptedcopy - copy semantics for the internal queuepublic static <T> Iterator<Queue<Optional<T>>> trails(int trailSize, Iterable<T> iterable)
iterable: [1,2,3,4], trailSize: 3 ->
[[Nothing, Nothing, Just 1],[Nothing Just 1, Just 2], [Just 1, Just 2, Just 3], [Just 2, Just 3, Just 4]]
T - the adapted iterator element typetrailSize - the trail sizeiterable - the iterable to be adaptedpublic static <T,W extends Collection<?>> Iterator<W> trails(int trailSize, Iterable<T> iterable, Function<Queue<Optional<T>>,W> copy)
iterable: [1,2,3,4], trailSize: 3 ->
[[Nothing, Nothing, Just 1],[Nothing Just 1, Just 2], [Just 1, Just 2, Just 3], [Just 2, Just 3, Just 4]]
T - the adapted iterator element typeW - the window typetrailSize - the trail sizeiterable - the iterable to be adaptedcopy - copy semantics for the internal queueCopyright © 2017. All rights reserved.