Package nl.siegmann.epublib.util
Class CollectionUtil
- java.lang.Object
-
- nl.siegmann.epublib.util.CollectionUtil
-
public class CollectionUtil extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classCollectionUtil.IteratorEnumerationAdapter<T>Wraps an Enumeration around an Iterator
-
Constructor Summary
Constructors Constructor Description CollectionUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> java.util.Enumeration<T>createEnumerationFromIterator(java.util.Iterator<T> it)Creates an Enumeration out of the given Iterator.static <T> Tfirst(java.util.List<T> list)Returns the first element of the list, null if the list is null or empty.static booleanisEmpty(java.util.Collection<?> collection)Whether the given collection is null or has no elements.
-
-
-
Method Detail
-
createEnumerationFromIterator
public static <T> java.util.Enumeration<T> createEnumerationFromIterator(java.util.Iterator<T> it)
Creates an Enumeration out of the given Iterator.- Type Parameters:
T-- Parameters:
it-- Returns:
- an Enumeration created out of the given Iterator.
-
first
public static <T> T first(java.util.List<T> list)
Returns the first element of the list, null if the list is null or empty.- Type Parameters:
T-- Parameters:
list-- Returns:
- the first element of the list, null if the list is null or empty.
-
isEmpty
public static boolean isEmpty(java.util.Collection<?> collection)
Whether the given collection is null or has no elements.- Parameters:
collection-- Returns:
- Whether the given collection is null or has no elements.
-
-