at.tuwien.ifs.somtoolbox.util
Class CollectionUtils
java.lang.Object
at.tuwien.ifs.somtoolbox.util.CollectionUtils
public class CollectionUtils
- extends Object
Utility methods related to collections.
- Version:
- $Id: CollectionUtils.java 3583 2010-05-21 10:07:41Z mayer $
- Author:
- Rudolf Mayer
Method Summary |
static HashMap<String,Integer> |
getOrCreateValue(HashMap<Integer,HashMap<String,Integer>> map,
Integer key)
|
static HashSet<String> |
getOrCreateValue(Map<String,HashSet<String>> map,
String key)
|
static ArrayList<String>[] |
getUniqueElements(Collection<? extends String> list1,
Collection<? extends String> list2)
Returns two ArrayLists, containing the elements only present in the first and second argument, respectively. |
static ArrayList<String>[] |
getUniqueElements(String[] array1,
String[] array2)
|
static int |
indexOf(ArrayList<String> list,
String value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CollectionUtils
public CollectionUtils()
getUniqueElements
public static ArrayList<String>[] getUniqueElements(Collection<? extends String> list1,
Collection<? extends String> list2)
- Returns two ArrayLists, containing the elements only present in the first and second argument, respectively.
getUniqueElements
public static ArrayList<String>[] getUniqueElements(String[] array1,
String[] array2)
getOrCreateValue
public static HashSet<String> getOrCreateValue(Map<String,HashSet<String>> map,
String key)
getOrCreateValue
public static HashMap<String,Integer> getOrCreateValue(HashMap<Integer,HashMap<String,Integer>> map,
Integer key)
indexOf
public static int indexOf(ArrayList<String> list,
String value)