Class CollectionUtil
java.lang.Object
nl.siegmann.epublib.util.CollectionUtil
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classWraps an Enumeration around an Iterator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Enumeration<T> Creates an Enumeration out of the given Iterator.static <T> TReturns the first element of the list, null if the list is null or empty.static booleanisEmpty(Collection<?> collection) Whether the given collection is null or has no elements.
-
Constructor Details
-
CollectionUtil
public CollectionUtil()
-
-
Method Details
-
createEnumerationFromIterator
Creates an Enumeration out of the given Iterator.- Type Parameters:
T-- Parameters:
it-- Returns:
- an Enumeration created out of the given Iterator.
-
first
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
Whether the given collection is null or has no elements.- Parameters:
collection-- Returns:
- Whether the given collection is null or has no elements.
-