|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.alee.utils.CollectionUtils
public final class CollectionUtils
This class provides a set of utilities to work with collections.
Constructor Summary | |
---|---|
CollectionUtils()
|
Method Summary | ||
---|---|---|
static
|
addAll(java.util.Collection<T> collection,
T... objects)
Adds all objects into specified list. |
|
static boolean |
areEqual(java.util.List list1,
java.util.List list2)
Returns whether lists are equal or not. |
|
static
|
clone(java.util.Collection<T> collection)
Returns clone of the specified list. |
|
static
|
copy(java.util.Collection<T> collection)
Returns copy of the specified list. |
|
static
|
copy(T... data)
Returns data converted into list. |
|
static
|
filter(java.util.Collection<T> collection,
Filter<T> filter)
Returns list of elements filtered from collection. |
|
static
|
keysList(java.util.Map<K,V> map)
Returns map keys list. |
|
static
|
removeNulls(java.util.List<T> list)
Removes all null elements from list. |
|
static int[] |
toArray(java.util.List<java.lang.Integer> list)
Returns an int array created using Integer list. |
|
static
|
toList(java.util.Deque<T> deque)
Returns a list of objects converted from deque. |
|
static
|
toList(T[] array)
Returns a list of objects converted from array. |
|
static
|
toStringList(java.util.List<T> list,
TextProvider<T> textProvider)
Returns list of strings extracted from the specified elements list. |
|
static
|
valuesList(java.util.Map<K,V> map)
Returns map values list. |
|
static
|
valuesSummaryList(java.util.Map<K,java.util.List<V>> map)
Returns map values summary list with unique elements only. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CollectionUtils()
Method Detail |
---|
public static <T> boolean addAll(java.util.Collection<T> collection, T... objects)
T
- objects typecollection
- list to fillobjects
- objects
public static <T> java.util.List<T> copy(java.util.Collection<T> collection)
T
- list typecollection
- list to copy
public static <T extends java.lang.Cloneable> java.util.List<T> clone(java.util.Collection<T> collection)
T
- list typecollection
- list to clone
public static <T> java.util.List<T> copy(T... data)
T
- data typedata
- data
public static <T> java.util.List<T> removeNulls(java.util.List<T> list)
T
- list typelist
- list to refactor
public static boolean areEqual(java.util.List list1, java.util.List list2)
list1
- first listlist2
- second list
public static <T> java.util.List<java.lang.String> toStringList(java.util.List<T> list, TextProvider<T> textProvider)
T
- elements typelist
- elements listtextProvider
- text provider
public static int[] toArray(java.util.List<java.lang.Integer> list)
list
- Integer list
public static <T> java.util.List<T> toList(T[] array)
T
- data typearray
- data array
public static <T> java.util.List<T> toList(java.util.Deque<T> deque)
T
- data typedeque
- data deque
public static <T> java.util.List<T> filter(java.util.Collection<T> collection, Filter<T> filter)
T
- elements typecollection
- collecton to filterfilter
- filter to process
public static <K,V> java.util.List<K> keysList(java.util.Map<K,V> map)
K
- key object typeV
- value object typemap
- map to process
public static <K,V> java.util.List<V> valuesList(java.util.Map<K,V> map)
K
- key object typeV
- value object typemap
- map to process
public static <K,V> java.util.List<V> valuesSummaryList(java.util.Map<K,java.util.List<V>> map)
K
- key object typeV
- value object typemap
- map to process
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |