public final class CollectionUtil
extends java.lang.Object
java.util.collection-related utility methods.| Modifier and Type | Field and Description |
|---|---|
static java.util.Iterator |
AT_END
Deprecated.
Moved to
IteratorUtil.AT_END |
static java.util.SortedMap |
EMPTY_SORTED_MAP
Deprecated.
Has moved to
MapUtil.EMPTY_SORTED_MAP |
static java.util.SortedSet |
EMPTY_SORTED_SET
Desperately missing from
java.util.Collections. |
| Modifier and Type | Method and Description |
|---|---|
static <K,V> java.util.SortedMap<K,V> |
emptySortedMap()
Deprecated.
Has moved to
MapUtil.emptySortedMap() |
static <T> java.util.SortedSet<T> |
emptySortedSet()
Desperately missing from
java.util.Collections. |
static <K,V> java.util.Map.Entry<K,V> |
entry(K key,
V initialValue)
Deprecated.
Has moved to
MapUtil.entry(Object, Object) |
static <K,V> java.util.HashMap<K,V> |
hashMapOf(int initialCapacity,
java.util.Map.Entry<K,V>... entries)
Deprecated.
Has moved to
MapUtil.hashMapOf(int, java.util.Map.Entry...) |
static <K,V> java.util.HashMap<K,V> |
hashMapOf(java.util.Map.Entry<K,V>... entries)
Deprecated.
Has moved to
MapUtil.hashMapOf(java.util.Map.Entry...) |
static <K,V> java.util.Map<K,V> |
map(K[] keys,
V[] values)
Deprecated.
Has moved to
MapUtil.map(Object[], Object[]) |
static <K,V> java.util.Map<K,V> |
map(java.lang.Object... keyValuePairs)
Deprecated.
Has moved to
MapUtil.map(Object...) |
static <K,V,M extends java.util.Map<K,V>> |
putAll(M subject,
boolean allowDuplicateKeys,
java.util.Map.Entry<K,V>... entries)
Deprecated.
Has moved to
MapUtil.putAll(Map, boolean, java.util.Map.Entry...) |
static <K,V,M extends java.util.Map<K,V>> |
putAll(M subject,
java.util.Map.Entry<K,V>... entries)
Deprecated.
Has moved to
MapUtil.putAll(Map, java.util.Map.Entry...) |
static <T> T |
removeFirstFrom(java.util.Collection<T> subject)
Removes and returns the first element of the given collection.
|
static <T> java.util.Collection<T> |
sorted(java.util.Collection<T> collection)
Returns an unmodifiable collection containing the elements of the given collection, but sorted by
their "natural ordering".
|
static <K,V> java.util.TreeMap<K,V> |
treeMapOf(java.util.Map.Entry<K,V>... entries)
Deprecated.
Has moved to
MapUtil.treeMapOf(java.util.Map.Entry...) |
@Deprecated public static final java.util.SortedMap EMPTY_SORTED_MAP
MapUtil.EMPTY_SORTED_MAPpublic static final java.util.SortedSet EMPTY_SORTED_SET
java.util.Collections.@Deprecated public static final java.util.Iterator AT_END
IteratorUtil.AT_END@Nullable public static <T> T removeFirstFrom(java.util.Collection<T> subject)
null iff the collection is empty@Deprecated public static <K,V> java.util.Map<K,V> map(java.lang.Object... keyValuePairs)
MapUtil.map(Object...)@Deprecated
public static <K,V> java.util.Map<K,V> map(K[] keys,
V[] values)
MapUtil.map(Object[], Object[])@Deprecated public static <K,V> java.util.HashMap<K,V> hashMapOf(java.util.Map.Entry<K,V>... entries)
MapUtil.hashMapOf(java.util.Map.Entry...)@Deprecated
public static <K,V> java.util.HashMap<K,V> hashMapOf(int initialCapacity,
java.util.Map.Entry<K,V>... entries)
MapUtil.hashMapOf(int, java.util.Map.Entry...)@Deprecated public static <K,V> java.util.TreeMap<K,V> treeMapOf(java.util.Map.Entry<K,V>... entries)
MapUtil.treeMapOf(java.util.Map.Entry...)@Deprecated
public static <K,V,M extends java.util.Map<K,V>> M putAll(M subject,
java.util.Map.Entry<K,V>... entries)
MapUtil.putAll(Map, java.util.Map.Entry...)@Deprecated
public static <K,V,M extends java.util.Map<K,V>> M putAll(M subject,
boolean allowDuplicateKeys,
java.util.Map.Entry<K,V>... entries)
MapUtil.putAll(Map, boolean, java.util.Map.Entry...)@Deprecated
public static <K,V> java.util.Map.Entry<K,V> entry(K key,
V initialValue)
MapUtil.entry(Object, Object)@Deprecated public static <K,V> java.util.SortedMap<K,V> emptySortedMap()
MapUtil.emptySortedMap()public static <T> java.util.SortedSet<T> emptySortedSet()
java.util.Collections.public static <T> java.util.Collection<T> sorted(java.util.Collection<T> collection)