public final class CollectionUtil extends Object
java.util.collection
-related utility methods.Modifier and Type | Field and Description |
---|---|
static Iterator |
AT_END
Deprecated.
Moved to
IteratorUtil.AT_END |
static SortedMap |
EMPTY_SORTED_MAP
Deprecated.
Has moved to
MapUtil.EMPTY_SORTED_MAP |
static SortedSet |
EMPTY_SORTED_SET
Deprecated.
Has moved to
Sets.EMPTY_SORTED_SET |
Modifier and Type | Method and Description |
---|---|
static <K,V> SortedMap<K,V> |
emptySortedMap()
Deprecated.
Has moved to
MapUtil.emptySortedMap() |
static <T> SortedSet<T> |
emptySortedSet()
Deprecated.
Has moved to
Sets.emptySortedSet() |
static <K,V> Map.Entry<K,V> |
entry(K key,
V initialValue)
Deprecated.
Has moved to
MapUtil.entry(Object, Object) |
static <K,V> HashMap<K,V> |
hashMapOf(int initialCapacity,
Map.Entry<K,V>... entries)
Deprecated.
Has moved to
MapUtil.hashMapOf(int, java.util.Map.Entry...) |
static <K,V> HashMap<K,V> |
hashMapOf(Map.Entry<K,V>... entries)
Deprecated.
Has moved to
MapUtil.hashMapOf(java.util.Map.Entry...) |
static <K,V> Map<K,V> |
map(K[] keys,
V[] values)
Deprecated.
Has moved to
MapUtil.map(Object[], Object[]) |
static <K,V> Map<K,V> |
map(Object... keyValuePairs)
Deprecated.
Has moved to
MapUtil.map(Object...) |
static <K,V,M extends Map<K,V>> |
putAll(M subject,
boolean allowDuplicateKeys,
Map.Entry<K,V>... entries)
Deprecated.
Has moved to
MapUtil.putAll(Map, boolean, java.util.Map.Entry...) |
static <K,V,M extends Map<K,V>> |
putAll(M subject,
Map.Entry<K,V>... entries)
Deprecated.
Has moved to
MapUtil.putAll(Map, java.util.Map.Entry...) |
static <T> T |
removeFirstFrom(Collection<T> subject)
Removes and returns the first element of the given collection.
|
static <T> Collection<T> |
sorted(Collection<T> collection)
Returns an unmodifiable collection containing the elements of the given collection, but sorted by
their "natural ordering".
|
static char[] |
toCharArray(Set<Character> charSet) |
static int[] |
toIntArray(Set<Integer> intSet) |
static <K,V> TreeMap<K,V> |
treeMapOf(Map.Entry<K,V>... entries)
Deprecated.
Has moved to
MapUtil.treeMapOf(java.util.Map.Entry...) |
@Deprecated public static final SortedMap EMPTY_SORTED_MAP
MapUtil.EMPTY_SORTED_MAP
@Deprecated public static final SortedSet EMPTY_SORTED_SET
Sets.EMPTY_SORTED_SET
@Deprecated public static final Iterator AT_END
IteratorUtil.AT_END
@Nullable public static <T> T removeFirstFrom(Collection<T> subject)
null
iff the collection is empty@Deprecated public static <K,V> Map<K,V> map(Object... keyValuePairs)
MapUtil.map(Object...)
@Deprecated public static <K,V> Map<K,V> map(K[] keys, V[] values)
MapUtil.map(Object[], Object[])
@Deprecated public static <K,V> HashMap<K,V> hashMapOf(Map.Entry<K,V>... entries)
MapUtil.hashMapOf(java.util.Map.Entry...)
@Deprecated public static <K,V> HashMap<K,V> hashMapOf(int initialCapacity, Map.Entry<K,V>... entries)
MapUtil.hashMapOf(int, java.util.Map.Entry...)
@Deprecated public static <K,V> TreeMap<K,V> treeMapOf(Map.Entry<K,V>... entries)
MapUtil.treeMapOf(java.util.Map.Entry...)
@Deprecated public static <K,V,M extends Map<K,V>> M putAll(M subject, Map.Entry<K,V>... entries)
MapUtil.putAll(Map, java.util.Map.Entry...)
@Deprecated public static <K,V,M extends Map<K,V>> M putAll(M subject, boolean allowDuplicateKeys, Map.Entry<K,V>... entries)
MapUtil.putAll(Map, boolean, java.util.Map.Entry...)
@Deprecated public static <K,V> Map.Entry<K,V> entry(K key, V initialValue)
MapUtil.entry(Object, Object)
@Deprecated public static <K,V> SortedMap<K,V> emptySortedMap()
MapUtil.emptySortedMap()
@Deprecated public static <T> SortedSet<T> emptySortedSet()
Sets.emptySortedSet()
public static <T> Collection<T> sorted(Collection<T> collection)
public static char[] toCharArray(Set<Character> charSet)
char[]
that contains all elements of the charSetNullPointerException
- The charSet contained a null
elementpublic static int[] toIntArray(Set<Integer> intSet)
int[]
that contains all elements of the intSetNullPointerException
- The intSet contained a null
elementCopyright © 2018 Arno Unkrig. All rights reserved.