public final class Collect extends Object
| Modifier and Type | Method and Description |
|---|---|
static <E> Iterator<E> |
enumerationToIterator(Enumeration<E> enumeration)
Wraps
Enumeration in the Iterator. |
static <E> List<E> |
iteratorToList(Iterator<E> iter)
Converts
Iterator to list |
static <E> Set<E> |
iteratorToSet(Iterator<E> iter)
Converts
Iterator to a set |
static <E> List<E> |
listOf(E... elements)
Create list of elements
|
static <E> Set<E> |
setOf(E... elements)
Create a set of elements
|
@SafeVarargs public static <E> List<E> listOf(E... elements)
E - type of the elementselements - elements of the future list@SafeVarargs public static <E> Set<E> setOf(E... elements)
E - type of the elementselements - elements of the future setpublic static <E> List<E> iteratorToList(Iterator<E> iter)
Iterator to listE - type of elementsiter - iterator to read into listpublic static <E> Set<E> iteratorToSet(Iterator<E> iter)
Iterator to a setE - type of elementsiter - iterator to read into a setpublic static <E> Iterator<E> enumerationToIterator(Enumeration<E> enumeration)
Enumeration in the Iterator.E - Element type.enumeration - Enumeration to wrap.Copyright © 2018. All rights reserved.