|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eel.kitchen.util.CollectionUtils
public final class CollectionUtils
Utilities to provide simple generics equivalents to some of Apache's commons-collection package (which still doesn't use generics as of 2011!)
| Constructor Summary | |
|---|---|
CollectionUtils()
|
|
| Method Summary | ||
|---|---|---|
static
|
toMap(Iterator<Map.Entry<K,V>> iterator)
Generics equivalent of commons-collections' IteratorUtils.toMap() |
|
static
|
toSet(Iterator<T> iterator)
Return a "type-safe" set |
|
static
|
toSortedMap(Iterator<Map.Entry<K,V>> iterator)
Like #toMap, but returns a SortedMap instead of a plain Map. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CollectionUtils()
| Method Detail |
|---|
public static <K,V> Map<K,V> toMap(Iterator<Map.Entry<K,V>> iterator)
Generics equivalent of commons-collections' IteratorUtils.toMap()
K - keys typeV - values typeiterator - The entry iterator to build the map out of
HashMappublic static <K,V> SortedMap<K,V> toSortedMap(Iterator<Map.Entry<K,V>> iterator)
SortedMap instead of a plain Map.
Note that it returns a TreeMap, which is not
thread-safe (we don't need it in our context anyway).
K - keys typeV - values typeiterator - The entry iterator to build the map out of
TreeMappublic static <T> Set<T> toSet(Iterator<T> iterator)
Return a "type-safe" set
T - elements typeiterator - the iterator to build the set out of
HashSet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||