Constructor and Description |
---|
FirstNCollector(int n) |
Modifier and Type | Method and Description |
---|---|
boolean |
addElement(Element element)
collect one element.
|
<T extends Collection<? super Element>> |
finish(T collection)
Finish collection of elements and add all collected elements into the given
Collection . |
public boolean addElement(Element element)
Collector
addElement
in interface Collector<Element>
element
- the element to collectpublic <T extends Collection<? super Element>> T finish(T collection)
Collector
Collection
.finish
in interface Collector<Element>
T
- Type of collectioncollection
- Collection
for storing collected elements.Collection
instance given in the parameter.Copyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.