public abstract class Collecting extends Object
| Constructor and Description |
|---|
Collecting() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Iterable<E>,E> |
flat()
Returns a
Collector that accumulates and flats the input elements into a
new List. |
static <T extends Iterable<E>,R extends Collection<E>,E> |
flat(Supplier<R> supplier)
Returns a
Collector that accumulates and flats the input elements into a
new Collection, in encounter order. |
static <T> Collector<T,?,Deque<T>> |
reverse()
Returns a
Collector that accumulates in reverse order the items into a new Deque. |
public static <T extends Iterable<E>,E> Collector<T,?,T> flat()
Collector that accumulates and flats the input elements into a
new List. There are no guarantees on the type, mutability, serializability,
or thread-safety of the List returned; if more control over the returned
List is required, use flat(Supplier).T - the type of the input elements (it must be Iterable)Collector which collects and flats all the input elements into a
List, in encounter orderpublic static <T extends Iterable<E>,R extends Collection<E>,E> Collector<T,?,R> flat(Supplier<R> supplier)
Collector that accumulates and flats the input elements into a
new Collection, in encounter order. The Collection is created by
the provided supplier.T - the type of the input elements (it must be Iterable)R - the type of the resulting Collectionsupplier - a Supplier which returns a new, empty Collection of
the appropriate typeCollector which collects and flats all the input elements into a
Collection, in encounter orderCopyright © 2017. All rights reserved.