public final class CollectionUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static <V> void |
addAllIfNotNull(Collection<V> collection,
Collection<V> values) |
static <V> boolean |
addIfNotNull(Collection<V> collection,
V value) |
static void |
append(StringBuilder string,
Collection<? extends Object> values) |
static void |
append(StringBuilder buffer,
Collection<? extends Object> values,
boolean skipNulls,
String separator) |
static void |
append(StringBuilder buffer,
Collection<? extends Object> values,
String separator) |
static List<? extends Object> |
arrayToList(Object value) |
static <V> boolean |
collectionContains(Map<Object,Collection<V>> map,
Object key,
V value) |
static <T> boolean |
containsReference(List<WeakReference<T>> list,
T object) |
static <T> List<T> |
copy(List<T> list) |
static <V> Set<V> |
createHashSet(Collection<? extends V> set) |
static <V> Set<V> |
createLinkedHashSet(Collection<? extends V> set) |
static <T> T |
get(Collection<T> collection,
int index) |
static <K,V> int |
getCollectionSize(Map<K,? extends Collection<V>> map,
K key) |
static <T> List<T> |
getReferences(List<WeakReference<T>> list) |
static <K,V> Set<V> |
getSet(Map<K,Set<V>> map,
K key) |
static <V> List<V> |
list(Iterable<? extends V> values) |
static <V> List<V> |
list(V... values) |
static <T> void |
removeReference(List<WeakReference<T>> list,
T object) |
static String |
replaceProperties(CharSequence string,
Map<String,Object> properties) |
static <K,V> boolean |
setContains(Map<K,Set<V>> map,
K key,
V value) |
static <K extends Comparable<K>,V extends Comparable<V>> |
sortByValues(Map<K,V> map) |
static List<String> |
split(String text,
String regex) |
static <T> List<T> |
subList(Iterable<T> iterable,
int size) |
static float[] |
toFloatArray(double[] doubleArray) |
static List<Double> |
toList(double... values) |
static List<Integer> |
toList(int... values) |
static <V> List<V> |
toList(V... values) |
static String |
toListString(Iterable<? extends Object> iterable)
Create a string using the same style as java.util.List.toString.
|
static String |
toListString(Iterator<? extends Object> iterator) |
static String |
toString(boolean skipNulls,
String separator,
Collection<? extends Object> values) |
static String |
toString(boolean skipNulls,
String separator,
Object... values) |
static String |
toString(Collection<? extends Object> values)
Convert the collection to a string, using the "," separator between each
value.
|
static String |
toString(String separator,
Collection<? extends Object> values)
Convert the collection to a string, using the separator between each value.
|
static String |
toString(String separator,
int... values) |
static String |
toString(String separator,
Object... values) |
static List<String> |
toStringList(Collection<?> values) |
public static <V> void addAllIfNotNull(Collection<V> collection, Collection<V> values)
public static <V> boolean addIfNotNull(Collection<V> collection, V value)
public static void append(StringBuilder string, Collection<? extends Object> values)
public static void append(StringBuilder buffer, Collection<? extends Object> values, boolean skipNulls, String separator)
public static void append(StringBuilder buffer, Collection<? extends Object> values, String separator)
public static <V> boolean collectionContains(Map<Object,Collection<V>> map, Object key, V value)
public static <T> boolean containsReference(List<WeakReference<T>> list, T object)
public static <V> Set<V> createHashSet(Collection<? extends V> set)
public static <V> Set<V> createLinkedHashSet(Collection<? extends V> set)
public static <T> T get(Collection<T> collection, int index)
public static <K,V> int getCollectionSize(Map<K,? extends Collection<V>> map, K key)
public static <T> List<T> getReferences(List<WeakReference<T>> list)
public static <V> List<V> list(V... values)
public static <T> void removeReference(List<WeakReference<T>> list, T object)
public static final String replaceProperties(CharSequence string, Map<String,Object> properties)
public static <K extends Comparable<K>,V extends Comparable<V>> Map<K,V> sortByValues(Map<K,V> map)
public static float[] toFloatArray(double[] doubleArray)
public static <V> List<V> toList(V... values)
public static String toListString(Iterable<? extends Object> iterable)
iterator - public static String toString(boolean skipNulls, String separator, Collection<? extends Object> values)
public static String toString(Collection<? extends Object> values)
values - The values.separator - The separator.public static String toString(String separator, Collection<? extends Object> values)
separator - The separator.values - The values.public static List<String> toStringList(Collection<?> values)
Copyright © 2015 Revolution Systems Inc.. All rights reserved.