public final class IteratorUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T> List<T> |
asList(Iterator<T> iterator)
Returns a List view of an Iterator.
|
static <T> T |
head(Iterator<T> iterator)
Consumes and returns the first element in an iterator, or returns null if there are none.
|
public static <T> T head(Iterator<T> iterator)
T
- the type parameter of the iteratoriterator
- the iteratorpublic static <T> List<T> asList(Iterator<T> iterator)
T
- the type parameter of the iteratoriterator
- the iteratorCopyright © 2017. All rights reserved.