|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.cs.crystal.util.CollectionMethods
public class CollectionMethods
Nested Class Summary | |
---|---|
static interface |
CollectionMethods.Mapping<I,O>
Interface used for the method in a map call. |
Constructor Summary | |
---|---|
CollectionMethods()
|
Method Summary | ||
---|---|---|
static
|
addToMultiMap(K key,
V val,
Map<K,List<V>> map)
Add an element to a 'multi-map.' Modifies the map in place. |
|
static
|
concat(List<? extends T> l1,
List<? extends T> l2)
Concatenates two lists. |
|
static
|
createSetWithoutElement(Set<T> s,
T element)
|
|
static
|
map(List<? extends I> list,
CollectionMethods.Mapping<I,O> fun)
Functional map, returns a new list. |
|
static
|
mutableSet(T... elements)
Creates a set from an array of elements (i.e., duplicate elements will be dropped). |
|
static
|
union(Map<? extends K,? extends V> m1,
Map<? extends K,? extends V> m2)
Return the union of two maps without modifying either one. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CollectionMethods()
Method Detail |
---|
public static <I,O> List<O> map(List<? extends I> list, CollectionMethods.Mapping<I,O> fun)
public static <T> List<T> concat(List<? extends T> l1, List<? extends T> l2)
public static <K,V> Map<K,V> union(Map<? extends K,? extends V> m1, Map<? extends K,? extends V> m2)
public static <K,V> void addToMultiMap(K key, V val, Map<K,List<V>> map)
public static <T> Set<T> createSetWithoutElement(Set<T> s, T element)
public static <T> Set<T> mutableSet(T... elements)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |