|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjlibs.core.util.CollectionUtil
public class CollectionUtil
| Constructor Summary | |
|---|---|
CollectionUtil()
|
|
| Method Summary | ||
|---|---|---|
static
|
add(List<E> list,
int index,
T item)
Adds the given item to the list at specified index. |
|
static
|
addAll(Collection<E> c,
T... array)
Adds objects in array to the given collection |
|
static
|
filter(Collection<T> c,
Filter<T> filter)
Returns List with elements from given collections which are selected by specified filter |
|
static
|
getKey(Map<K,V> map,
V value)
returns key whose value matches with specified value from given map if the given map contains multiple keys mapped to specified value, it returns first key encountered |
|
static Properties |
readProperties(InputStream is,
Properties props)
Reads Properties from given inputStream and returns it. |
|
static
|
removeAll(Collection<E> c,
T... array)
Removes objects in array to the given collection |
|
static boolean[] |
toBooleanArray(Collection<Boolean> c)
|
|
static byte[] |
toByteArray(Collection<? extends Number> c)
|
|
static double[] |
toDoubleArray(Collection<? extends Number> c)
|
|
static float[] |
toFloatArray(Collection<? extends Number> c)
|
|
static int[] |
toIntArray(Collection<? extends Number> c)
|
|
static long[] |
toLongArray(Collection<? extends Number> c)
|
|
static short[] |
toShortArray(Collection<? extends Number> c)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CollectionUtil()
| Method Detail |
|---|
public static Properties readProperties(InputStream is,
Properties props)
throws IOException
IOException
public static <E,T extends E> Collection<E> addAll(Collection<E> c,
T... array)
public static <E,T extends E> Collection<E> removeAll(Collection<E> c,
T... array)
public static <E,T extends E> void add(List<E> list,
int index,
T item)
index.
if index is greater than list size, it simply appends
to the list.
public static <T> List<T> filter(Collection<T> c,
Filter<T> filter)
public static <K,V> K getKey(Map<K,V> map,
V value)
public static boolean[] toBooleanArray(Collection<Boolean> c)
public static int[] toIntArray(Collection<? extends Number> c)
public static long[] toLongArray(Collection<? extends Number> c)
public static float[] toFloatArray(Collection<? extends Number> c)
public static double[] toDoubleArray(Collection<? extends Number> c)
public static byte[] toByteArray(Collection<? extends Number> c)
public static short[] toShortArray(Collection<? extends Number> c)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||