| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final float | DEFAULT_LOAD_FACTOR
Default load factor for |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static List | Returns: the converted List resultthe (potentially primitive) array source)Convert the supplied array into a List. |
| private static int | |
| public static boolean | |
| public static boolean | Returns: true if found, false otherwisethe Enumeration to check enumeration, Object the element to look for element)Check whether the given Enumeration contains the given element. |
| public static boolean | Returns: whether any of the candidates has been foundthe source Collection source, Collection<?> the candidates to search for candidates)Return |
| public static boolean | Returns: true if found, false otherwisethe Collection to check collection, Object the element to look for element)Check whether the given Collection contains the given element instance. |
| public static Class | Returns: the common element type, ornull if no clear
common type has been found (or the collection was empty)the Collection to check collection)Find the common element type of the given Collection, if any. |
| public static <E> E | Returns: the first present object, ornull if not foundthe source Collection source, Collection<E> the candidates to search for candidates)Return the first element in ' |
| public static <T> T | Returns: a value of the given type found if there is a clear match, ornull if none or more than one such value foundthe Collection to search collection, Class<T> the type to look for type)Find a single value of the given type in the given Collection. |
| public static Object | Returns: a value of one of the given types found if there is a clear match, ornull if none or more than one such value foundthe collection to search collection, Class<?>[] the types to look for, in prioritized order types)Find a single value of one of the given types in the given Collection: searching the Collection for a value of the first type, then searching for a value of the second type, etc. |
| public static <T> T | Returns: the first element, ornull if nonethe Set to check (may be set)null or empty)Retrieve the first element of the given Set, using |
| public static <T> T | Returns: the first element, ornull if nonethe List to check (may be list)null or empty)Retrieve the first element of the given List, accessing the zero index. |
| public static boolean | Returns: true if the collection contains a single reference or
multiple references to the same instance, false otherwisethe Collection to check collection)Determine whether the given Collection only contains a single unique object. |
| public static boolean | Returns: whether the given Collection is emptythe Collection to check collection)Return |
| public static boolean | |
| public static <T> T | Returns: the last element, ornull if nonethe Set to check (may be set)null or empty)Retrieve the last element of the given Set, using |
| public static <T> T | Returns: the last element, ornull if nonethe List to check (may be list)null or empty)Retrieve the last element of the given List, accessing the highest index. |
| public static <E> void | mergeArrayIntoCollection(Object
the array to merge (may be array, Collection<E> null)the target Collection to merge the array into collection)Merge the given array into the given Collection. |
| public static <K, V> void | mergePropertiesIntoMap(Properties
the Properties instance to merge (may be props, Map<K, V> null)the target Map to merge the properties into map)Merge the given Properties instance into the given Map, copying all properties (key-value pairs) over. |
| public static <K, V> HashMap | newHashMap(int
the expected number of elements (with a corresponding
capacity to be derived so that no resize/rehash operations are needed) expectedSize)Instantiate a new |
| public static <K, V> LinkedHashMap | newLinkedHashMap(int
the expected number of elements (with a corresponding
capacity to be derived so that no resize/rehash operations are needed) expectedSize)Instantiate a new |
| public static <A, E extends A> A[] | toArray(Enumeration<E> enumeration, A[] array)
Marshal the elements from the given enumeration into an array of the given type. |
| public static <E> Iterator | Returns: the adaptedIteratorthe original enumeration)EnumerationAdapt an |
| public static <K, V> MultiValueMap | Returns: the adapted multi-value map (wrapping the original map)the original map targetMap)Adapt a |
| public static <K, V> MultiValueMap | Returns: an unmodifiable view of the specified multi-value mapthe map for which an unmodifiable view is to be returned. targetMap)Return an unmodifiable view of the specified multi-value map. |
| DEFAULT_LOAD_FACTOR | back to summary |
|---|---|
| pack-priv static final float DEFAULT_LOAD_FACTOR Default load factor for
| |
| CollectionUtils | back to summary |
|---|---|
| public CollectionUtils() | |
| arrayToList | back to summary |
|---|---|
| public static List Convert the supplied array into a List. A primitive array gets converted into a List of the appropriate wrapper type. Note Generally prefer the standard A
| |
| computeMapInitialCapacity | back to summary |
|---|---|
| private static int computeMapInitialCapacity(int expectedSize) | |
| contains | back to summary |
|---|---|
| public static boolean contains(Iterator<?> iterator, Object element) Check whether the given Iterator contains the given element. | |
| contains | back to summary |
|---|---|
| public static boolean contains(Enumeration<?> enumeration, Object element) Check whether the given Enumeration contains the given element.
| |
| containsAny | back to summary |
|---|---|
| public static boolean containsAny(Collection<?> source, Collection<?> candidates) Return
| |
| containsInstance | back to summary |
|---|---|
| public static boolean containsInstance(Collection<?> collection, Object element) Check whether the given Collection contains the given element instance. Enforces the given instance to be present, rather than returning
| |
| findCommonElementType | back to summary |
|---|---|
| public static Class Find the common element type of the given Collection, if any.
| |
| findFirstMatch | back to summary |
|---|---|
| public static <E> E findFirstMatch(Collection<?> source, Collection<E> candidates) Return the first element in '
| |
| findValueOfType | back to summary |
|---|---|
| public static <T> T findValueOfType(Collection<?> collection, Class<T> type) Find a single value of the given type in the given Collection.
| |
| findValueOfType | back to summary |
|---|---|
| public static Object findValueOfType(Collection<?> collection, Class<?>[] types) Find a single value of one of the given types in the given Collection: searching the Collection for a value of the first type, then searching for a value of the second type, etc.
| |
| firstElement | back to summary |
|---|---|
| public static <T> T firstElement(Set<T> set) Retrieve the first element of the given Set, using
| |
| firstElement | back to summary |
|---|---|
| public static <T> T firstElement(List<T> list) Retrieve the first element of the given List, accessing the zero index. | |
| hasUniqueObject | back to summary |
|---|---|
| public static boolean hasUniqueObject(Collection<?> collection) Determine whether the given Collection only contains a single unique object.
| |
| isEmpty | back to summary |
|---|---|
| public static boolean isEmpty(Collection<?> collection) Return
| |
| isEmpty | back to summary |
|---|---|
| public static boolean isEmpty(Map<?, ?> map) Return
| |
| lastElement | back to summary |
|---|---|
| public static <T> T lastElement(Set<T> set) Retrieve the last element of the given Set, using
| |
| lastElement | back to summary |
|---|---|
| public static <T> T lastElement(List<T> list) Retrieve the last element of the given List, accessing the highest index. | |
| mergeArrayIntoCollection | back to summary |
|---|---|
| public static <E> void mergeArrayIntoCollection(Object array, Collection<E> collection) Merge the given array into the given Collection.
| |
| mergePropertiesIntoMap | back to summary |
|---|---|
| public static <K, V> void mergePropertiesIntoMap(Properties props, Map<K, V> map) Merge the given Properties instance into the given Map, copying all properties (key-value pairs) over. Uses
| |
| newHashMap | back to summary |
|---|---|
| public static <K, V> HashMap Instantiate a new This differs from the regular
| |
| newLinkedHashMap | back to summary |
|---|---|
| public static <K, V> LinkedHashMap Instantiate a new This differs from the regular
| |
| toArray | back to summary |
|---|---|
| public static <A, E extends A> A[] toArray(Enumeration<E> enumeration, A[] array) Marshal the elements from the given enumeration into an array of the given type. Enumeration elements must be assignable to the type of the given array. The array returned will be a different instance than the array given. | |
| toIterator | back to summary |
|---|---|
| public static <E> Iterator Adapt an
| |
| toMultiValueMap | back to summary |
|---|---|
| public static <K, V> MultiValueMap Adapt a
| |
| unmodifiableMultiValueMap | back to summary |
|---|---|
| public static <K, V> MultiValueMap Return an unmodifiable view of the specified multi-value map.
| |