public abstract class Multiplexing extends Object
| Constructor and Description |
|---|
Multiplexing() |
| Modifier and Type | Method and Description |
|---|---|
static <E,I extends Iterator<E>> |
chain(I... iterators)
Flattens passed iterators of E to an iterator of E.
|
static <E,I extends Iterator<E>> |
chain(Iterable<I> iterators)
Flattens an iterable of iterators of E to an iterator of E.
|
static <E,I extends Iterator<E>> |
chain(Iterator<I> iterators)
Flattens an iterator of iterators of E to an iterator of E.
|
static <E> Iterator<E> |
cycle(E... array)
Creates an infinite iterator that issues elements from the parameter cyclicly.
|
static <E> Iterator<E> |
cycle(Iterable<E> iterable)
Creates an infinite iterator that issues elements from the parameter cyclicly.
|
static <E> Iterator<E> |
cycle(Iterator<E> iterator)
Creates an infinite iterator that issues elements from the parameter cyclicly.
|
static <E,I extends Iterable<E>> |
flatten(I... iterables)
Flattens passed iterables of E to an iterator of E.
|
static <I extends Iterable<E>,E> |
flatten(Iterable<I> iterables)
Flattens an iterable of iterables of E to an iterator of E.
|
static <I extends Iterable<E>,E> |
flatten(Iterator<I> iterables)
Flattens an iterator of iterables of E to an iterator of E.
|
static <E,I extends Iterator<E>> |
roundrobin(Iterable<I> iterators)
Multiplexes an iterator of iterators into an iterator.
|
static <E> Iterator<E> |
roundrobin(Iterator<E>... iterators)
Multiplexes an iterator of iterators into an iterator.
|
static <E,I extends Iterator<E>> |
roundrobin(Iterator<I> iterators)
Multiplexes an iterator of iterators into an iterator.
|
static <E,I extends Iterator<E>> |
roundrobinLongest(Iterable<I> iterators)
Multiplexes an iterable of iterators into a single iterator.
|
static <E> Iterator<Optional<E>> |
roundrobinLongest(Iterator<E>... iterators)
Multiplexes two iterators into a single iterator.
|
static <E,I extends Iterator<E>> |
roundrobinLongest(Iterator<I> iterators)
Multiplexes an iterator of iterators into a single iterator.
|
static <E,I extends Iterator<E>> |
roundrobinShortest(Iterable<I> iterators)
Multiplexes an iterable of iterators into a single iterator.
|
static <E> Iterator<E> |
roundrobinShortest(Iterator<E>... iterators)
Multiplexes two iterators into a single iterator.
|
static <E,I extends Iterator<E>> |
roundrobinShortest(Iterator<I> iterators)
Multiplexes an iterator of iterators into a single iterator.
|
static <E> Iterator<List<E>> |
unchain(int channelSize,
E... array)
Demultiplexes elements from the source array into an iterator of channels.
|
static <E> Iterator<List<E>> |
unchain(int channelSize,
Iterable<E> iterable)
Demultiplexes elements from the source iterable into an iterator of channels.
|
static <C extends Collection<E>,E> |
unchain(int channelSize,
Iterable<E> iterable,
Supplier<C> channelProvider)
Demultiplexes elements from the source iterable into an iterator of channels.
|
static <E> Iterator<List<E>> |
unchain(int channelSize,
Iterator<E> iterator)
Demultiplexes elements from the source iterator into an iterator of channels.
|
static <C extends Collection<E>,E> |
unchain(int channelSize,
Iterator<E> iterator,
Supplier<C> channelProvider)
Demultiplexes elements from the source iterator into an iterator of channels.
|
static <C extends Collection<E>,E> |
unchain(int channelSize,
Supplier<C> channelProvider,
E... array)
Demultiplexes elements from the source array into an iterator of channels.
|
static <E> Iterator<List<Optional<E>>> |
unchainLongest(int channelSize,
E... array)
Demultiplexes elements from the source array into an iterator of channels.
|
static <E> Iterator<List<Optional<E>>> |
unchainLongest(int channelSize,
Iterable<E> iterable)
Demultiplexes elements from the source array into an iterator of channels.
|
static <C extends Collection<Optional<E>>,E> |
unchainLongest(int channelSize,
Iterable<E> iterable,
Supplier<C> channelProvider)
Demultiplexes elements from the source array into an iterator of channels.
|
static <E> Iterator<List<Optional<E>>> |
unchainLongest(int channelSize,
Iterator<E> iterator)
Demultiplexes elements from the source array into an iterator of channels.
|
static <C extends Collection<Optional<E>>,E> |
unchainLongest(int channelSize,
Iterator<E> iterator,
Supplier<C> channelProvider)
Demultiplexes elements from the source array into an iterator of channels.
|
static <C extends Collection<Optional<E>>,E> |
unchainLongest(int channelSize,
Supplier<C> channelProvider,
E... array)
Demultiplexes elements from the source array into an iterator of channels.
|
static <E> Iterator<List<E>> |
unchainShortest(int channelSize,
E... array)
Demultiplexes elements from the source iterable into an iterator of channels.
|
static <E> Iterator<List<E>> |
unchainShortest(int channelSize,
Iterable<E> iterable)
Demultiplexes elements from the source iterable into an iterator of channels.
|
static <C extends Collection<E>,E> |
unchainShortest(int channelSize,
Iterable<E> iterable,
Supplier<C> channelProvider)
Demultiplexes elements from the source iterable into an iterator of channels.
|
static <E> Iterator<List<E>> |
unchainShortest(int channelSize,
Iterator<E> iterator)
Demultiplexes elements from the source iterable into an iterator of channels.
|
static <C extends Collection<E>,E> |
unchainShortest(int channelSize,
Iterator<E> iterator,
Supplier<C> channelProvider)
Demultiplexes elements from the source iterable into an iterator of channels.
|
static <C extends Collection<E>,E> |
unchainShortest(int channelSize,
Supplier<C> channelProvider,
E... array)
Demultiplexes elements from the source iterable into an iterator of channels.
|
public static <I extends Iterable<E>,E> Iterator<E> flatten(Iterator<I> iterables)
flatten([1,2], [3,4]) -> [1,2,3,4]
I - the iterable typeE - the iterable element typeiterables - the iterator of iterables to be flattenedpublic static <I extends Iterable<E>,E> Iterator<E> flatten(Iterable<I> iterables)
flatten([1,2], [3,4]) -> [1,2,3,4]
I - the iterable typeE - the iterable element typeiterables - the iterable of iterables to be flattenedpublic static <E,I extends Iterable<E>> Iterator<E> flatten(I... iterables)
flatten([1,2], [3,4]) -> [1,2,3,4]
E - the iterable element typeI - the iterable typeiterables - the array of iterables to be flattenedpublic static <E,I extends Iterator<E>> Iterator<E> chain(Iterator<I> iterators)
chain([1,2], [3,4]) -> [1,2,3,4]
E - the iterator element typeI - the iterator typeiterators - the source iteratorspublic static <E,I extends Iterator<E>> Iterator<E> chain(Iterable<I> iterators)
chain([1,2], [3,4]) -> [1,2,3,4]
E - the iterator element typeI - the iterator typeiterators - the source iterablepublic static <E,I extends Iterator<E>> Iterator<E> chain(I... iterators)
chain([1,2], [3,4]) -> [1,2,3,4]
E - the iterator element typeI - the iterator typeiterators - the array of iterators to be flattenedpublic static <C extends Collection<E>,E> Iterator<C> unchain(int channelSize, Iterator<E> iterator, Supplier<C> channelProvider)
unchain(2, [1,2,3,4,5]) -> [[1,2],[3,4],[5]]
C - the channel collection typeE - the element typechannelSize - maximum size of the channeliterator - the source iteratorchannelProvider - a supplier used to create channelspublic static <E> Iterator<List<E>> unchain(int channelSize, Iterator<E> iterator)
unchain(2, [1,2,3,4,5]) -> [[1,2],[3,4],[5]]
E - the element typechannelSize - maximum size of the channeliterator - the source iteratorpublic static <C extends Collection<E>,E> Iterator<C> unchain(int channelSize, Iterable<E> iterable, Supplier<C> channelProvider)
unchain(2, [1,2,3,4,5]) -> [[1,2],[3,4],[5]]
C - the channel collection typeE - the element typechannelSize - maximum size of the channeliterable - the source iterablechannelProvider - the supplier used to create channelspublic static <E> Iterator<List<E>> unchain(int channelSize, Iterable<E> iterable)
unchain(2, [1,2,3,4,5]) -> [[1,2],[3,4],[5]]
E - the element typechannelSize - maximum size of the channeliterable - the source iterablepublic static <C extends Collection<E>,E> Iterator<C> unchain(int channelSize, Supplier<C> channelProvider, E... array)
unchain(2, [1,2,3,4,5]) -> [[1,2],[3,4],[5]]
C - the channel collection typeE - the element typechannelSize - maximum size of the channelarray - the source arraychannelProvider - the supplier used to create channelspublic static <E> Iterator<List<E>> unchain(int channelSize, E... array)
unchain(2, [1,2,3,4,5]) -> [[1,2],[3,4],[5]]
E - the element typechannelSize - maximum size of the channelarray - the source arraypublic static <E,I extends Iterator<E>> Iterator<E> roundrobin(Iterator<I> iterators)
roundRobin([1,2], [3], [4,5]) -> [1,3,4,2,5]
E - the element typeI - the iterator typeiterators - the source iteratorpublic static <E,I extends Iterator<E>> Iterator<E> roundrobin(Iterable<I> iterators)
roundRobin([1,2], [3], [4,5]) -> [1,3,4,2,5]
E - the element typeI - the iterator typeiterators - the source iterablepublic static <E> Iterator<E> roundrobin(Iterator<E>... iterators)
roundRobin([1,2], [3]) -> [1,3,2]
E - the element typeiterators - the source iteratorspublic static <E,I extends Iterator<E>> Iterator<E> roundrobinShortest(Iterator<I> iterators)
roundrobinShortest([1,2,3], [4,5]) -> [1,4,2,5]
E - the element typeI - the iterator typeiterators - the iterator of iterators to be multiplexedpublic static <E,I extends Iterator<E>> Iterator<E> roundrobinShortest(Iterable<I> iterators)
roundrobinShortest([1,2,3], [4,5]) -> [1,4,2,5]
E - the element typeI - the source iterator typeiterators - the source iterablepublic static <E> Iterator<E> roundrobinShortest(Iterator<E>... iterators)
roundrobinShortest([1,2], [3]) -> [1,3]
E - the element typeiterators - the source iteratorspublic static <E,I extends Iterator<E>> Iterator<Optional<E>> roundrobinLongest(Iterator<I> iterators)
roundrobinLongest([1,2], [4]) -> [of 1, of 4, of 2, empty]
E - the element typeI - the iterator typeiterators - the source iteratorpublic static <E,I extends Iterator<E>> Iterator<Optional<E>> roundrobinLongest(Iterable<I> iterators)
roundrobinLongest([1,2], [4]) -> [of 1, of 4, of 2, empty]
E - the element typeI - the iterator typeiterators - the source iterablepublic static <E> Iterator<Optional<E>> roundrobinLongest(Iterator<E>... iterators)
roundrobinLongest([1,2], [4]) -> [of 1, of 4, of 2, empty]
E - the element typeiterators - the source iteratorspublic static <E> Iterator<E> cycle(Iterator<E> iterator)
E - the element typeiterator - the iterator to cyclepublic static <E> Iterator<E> cycle(Iterable<E> iterable)
E - the element typeiterable - the iterable to cyclepublic static <E> Iterator<E> cycle(E... array)
E - the element typearray - the array to cyclepublic static <C extends Collection<E>,E> Iterator<C> unchainShortest(int channelSize, Iterator<E> iterator, Supplier<C> channelProvider)
unchainShortest(2, [1,2,3,4,5]) -> [[1,2],[3,4]]
C - the channel collection typeE - the element typechannelSize - size of the channeliterator - the source iteratorchannelProvider - a supplier used to create channelspublic static <E> Iterator<List<E>> unchainShortest(int channelSize, Iterator<E> iterator)
unchainShortest(2, [1,2,3,4,5]) -> [[1,2],[3,4]]
E - the element typechannelSize - size of the channeliterator - the source iteratorpublic static <C extends Collection<E>,E> Iterator<C> unchainShortest(int channelSize, Iterable<E> iterable, Supplier<C> channelProvider)
unchainShortest(2, [1,2,3,4,5]) -> [[1,2],[3,4]]
C - the channel collection typeE - the element typechannelSize - size of the channeliterable - the source iterablechannelProvider - the supplier used to create channelspublic static <E> Iterator<List<E>> unchainShortest(int channelSize, Iterable<E> iterable)
unchainShortest(2, [1,2,3,4,5]) -> [[1,2],[3,4]]
E - the element typechannelSize - size of the channeliterable - the source iterablepublic static <C extends Collection<E>,E> Iterator<C> unchainShortest(int channelSize, Supplier<C> channelProvider, E... array)
unchainShortest(2, [1,2,3,4,5]) -> [[1,2],[3,4]]
C - the channel collection typeE - the element typechannelSize - size of the channelarray - the source arraychannelProvider - the supplier used to create channelspublic static <E> Iterator<List<E>> unchainShortest(int channelSize, E... array)
unchainShortest(2, [1,2,3,4,5]) -> [[1,2],[3,4]]
E - the element typechannelSize - size of the channelarray - the source arraypublic static <C extends Collection<Optional<E>>,E> Iterator<C> unchainLongest(int channelSize, Iterator<E> iterator, Supplier<C> channelProvider)
unchainLongest(2, [1,2,3,4,5]) -> [[just 1, just 2],[just 3, just 4],[just 5, nothing]]
C - the channel collection typeE - the element typechannelSize - size of the channeliterator - the source iteratorchannelProvider - the supplier used to create channelspublic static <E> Iterator<List<Optional<E>>> unchainLongest(int channelSize, Iterator<E> iterator)
unchainLongest(2, [1,2,3,4,5]) -> [[just 1, just 2],[just 3, just 4],[just 5, nothing]]
E - the element typechannelSize - size of the channeliterator - the source iteratorpublic static <C extends Collection<Optional<E>>,E> Iterator<C> unchainLongest(int channelSize, Iterable<E> iterable, Supplier<C> channelProvider)
unchainLongest(2, [1,2,3,4,5]) -> [[just 1, just 2],[just 3, just 4],[just 5, nothing]]
C - the channel collection typeE - the element typechannelSize - size of the channeliterable - the source iterablechannelProvider - the supplier used to create channelspublic static <E> Iterator<List<Optional<E>>> unchainLongest(int channelSize, Iterable<E> iterable)
unchainLongest(2, [1,2,3,4,5]) -> [[just 1, just 2],[just 3, just 4],[just 5, nothing]]
E - the element typechannelSize - size of the channeliterable - the source iterablepublic static <C extends Collection<Optional<E>>,E> Iterator<C> unchainLongest(int channelSize, Supplier<C> channelProvider, E... array)
unchainLongest(2, [1,2,3,4,5]) -> [[just 1, just 2],[just 3, just 4],[just 5, nothing]]
C - the channel collection typeE - the element typechannelSize - size of the channelchannelProvider - the supplier used to create channelsarray - the source arraypublic static <E> Iterator<List<Optional<E>>> unchainLongest(int channelSize, E... array)
unchainLongest(2, [1,2,3,4,5]) -> [[just 1, just 2],[just 3, just 4],[just 5, nothing]]
E - the element typechannelSize - size of the channelarray - the source arrayCopyright © 2017. All rights reserved.