| java.lang.Object com.vividsolutions.jump.util.CollectionUtil
CollectionUtil | public class CollectionUtil (Code) | | |
Method Summary | |
public static void | addIfNotNull(Object item, Collection collection) | public static Collection | collect(Collection collection, Block block) The Smalltalk #collect method. | public static List | combinations(List original, int maxCombinationSize) Returns a List of Lists: all combinations of the elements of the given List. | public static List | combinations(List original, int maxCombinationSize, Object mandatoryItem) Returns a List of Lists: all combinations of the elements of the given List. | public static List | combinations(List original) Returns a List of Lists: all combinations of the elements of the given List. | public static Collection | concatenate(Collection a, Collection b) | public static Collection | concatenate(Collection collections) | public static boolean | containsReference(Object[] objects, Object o) | public static Map | createMap(Object[] alternatingKeysAndValues) | public static Map | createMap(Class mapClass, Object[] alternatingKeysAndValues) | public static Collection | filterByClass(Collection collection, Class c) Modifies and returns the collection. | public static Object | get(Class c, Map map) | public static Object | ifNotIn(Object o, Collection c, Object alternative) | public static int | indexOf(Object o, Object[] objects) | public static Map | inverse(Map map) | public static List[] | keysAndCorrespondingValues(Map map) | public static List | list(Object a, Object b) | public static Object | randomElement(List list) | public static Collection | removeDuplicates(Collection original) Brute force, for when HashSet and TreeSet won't work (e.g. | public static void | removeKeys(Collection keys, Map map) | public static void | resize(List list, int newSize) | public static List | reverse(List list) | public static SortedSet | reverseSortedSet(int[] ints) | public static Collection | select(Collection collection, Block block) The Smalltalk #select method. | public static void | setIfNull(int i, List list, String value) | public static Collection | stretch(Collection source, Collection destination, int destinationSize) |
CollectionUtil | public CollectionUtil()(Code) | | |
combinations | public static List combinations(List original, int maxCombinationSize)(Code) | | Returns a List of Lists: all combinations of the elements of the given List.
Parameters: maxCombinationSize - combinations larger than this value are discarded |
combinations | public static List combinations(List original, int maxCombinationSize, Object mandatoryItem)(Code) | | Returns a List of Lists: all combinations of the elements of the given List.
Parameters: maxCombinationSize - combinations larger than this value are discarded Parameters: mandatoryItem - an item that all returned combinations must contain,or null to leave unspecified |
combinations | public static List combinations(List original)(Code) | | Returns a List of Lists: all combinations of the elements of the given List.
|
containsReference | public static boolean containsReference(Object[] objects, Object o)(Code) | | |
createMap | public static Map createMap(Object[] alternatingKeysAndValues)(Code) | | |
keysAndCorrespondingValues | public static List[] keysAndCorrespondingValues(Map map)(Code) | | The nth key corresponds to the nth value
|
removeDuplicates | public static Collection removeDuplicates(Collection original)(Code) | | Brute force, for when HashSet and TreeSet won't work (e.g. #hashCode
implementation isn't appropriate). The original Collection is not modified.
|
resize | public static void resize(List list, int newSize)(Code) | | |
|
|