public class CollectionUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CollectionUtils.EmptyEnumeration<E>
An empty enumeration.
|
Modifier and Type | Field and Description |
---|---|
static List |
EMPTY_LIST
Deprecated.
|
Constructor and Description |
---|
CollectionUtils() |
Modifier and Type | Method and Description |
---|---|
static <E> Enumeration<E> |
append(Enumeration<E> e1,
Enumeration<E> e2)
Append one enumeration to another.
|
static <T> Collection<T> |
asCollection(Iterator<? extends T> iter)
Returns a collection containing all elements of the iterator.
|
static <E> Enumeration<E> |
asEnumeration(Iterator<E> iter)
Adapt the specified Iterator to the Enumeration interface.
|
static <E> Iterator<E> |
asIterator(Enumeration<E> e)
Adapt the specified Enumeration to the Iterator interface.
|
static String |
flattenToString(Collection<?> c)
Creates a comma separated list of all values held in the given
collection.
|
static int |
frequency(Collection<?> c,
Object o)
Counts how often the given Object occurs in the given
collection using equals() for comparison.
|
@Deprecated public static final List EMPTY_LIST
public static <E> Enumeration<E> append(Enumeration<E> e1, Enumeration<E> e2)
E
- element typee1
- the first enumeration.e2
- the subsequent enumeration.public static <T> Collection<T> asCollection(Iterator<? extends T> iter)
T
- element typeiter
- the Iterator to convertpublic static <E> Enumeration<E> asEnumeration(Iterator<E> iter)
E
- element typeiter
- the Iterator to adapt.public static <E> Iterator<E> asIterator(Enumeration<E> e)
E
- element typee
- the Enumeration to adapt.public static String flattenToString(Collection<?> c)
c
- collection to transformpublic static int frequency(Collection<?> c, Object o)
c
- collection in which to searcho
- object to search