public class Collections extends Object
Options.isTestEnabled() is enabled, the methods return collections with predictable iteration order.| Modifier and Type | Method and Description |
|---|---|
static <T1,T2> void |
addAllToMapSet(Map<T1,Set<T2>> map,
T1 key,
Collection<T2> values)
Adds elements to a map of sets.
|
static <T1,T2> void |
addToMapList(Map<T1,List<T2>> map,
T1 key,
T2 value)
Adds an element to a map of lists.
|
static <T1,T2> void |
addToMapSet(Map<T1,Set<T2>> map,
T1 key,
T2 value)
Adds an element to a map of sets.
|
static <K,V> String |
diff(Map<K,V> m1,
Map<K,V> m2)
Returns a string description of the differences between the two maps.
|
static <T> List<T> |
newList()
Constructs a new empty list.
|
static <T> List<T> |
newList(Collection<T> s)
Constructs a new list from the given collection.
|
static <T1,T2> Map<T1,T2> |
newMap()
Constructs a new empty map.
|
static <T1,T2> Map<T1,T2> |
newMap(Map<T1,T2> m)
Constructs a new map as a copy of the given map.
|
static <T1,T2,T3> Map<T1,Map<T2,Set<T3>>> |
newMapMapSet(Map<T1,Map<T2,Set<T3>>> m)
Constructs a new map as a copy of the given map (with copies of its values which are map sets)
|
static <T1,T2> Map<T1,Set<T2>> |
newMapSet(Map<T1,Set<T2>> m)
Constructs a new map as a copy of the given map (with copies of its values which are sets)
|
static <T> Queue<T> |
newQueue()
Constructs a new empty queue.
|
static <T> Set<T> |
newSet()
Constructs a new empty set.
|
static <T> Set<T> |
newSet(Collection<T> s)
Constructs a new set from the given collection.
|
static <T> Set<T> |
singleton(T t)
Constructs a new mutable singleton set containing the given element.
|
static <K extends Comparable<K>,V> |
sortedEntries(Map<K,V> m)
Returns an ordered set of map entries, sorted by the natural order of the entry keys.
|
public static <T1,T2> void addAllToMapSet(Map<T1,Set<T2>> map, T1 key, Collection<T2> values)
public static <T1,T2> void addToMapList(Map<T1,List<T2>> map, T1 key, T2 value)
public static <T1,T2> void addToMapSet(Map<T1,Set<T2>> map, T1 key, T2 value)
public static <K,V> String diff(Map<K,V> m1, Map<K,V> m2)
public static <T> List<T> newList()
public static <T> List<T> newList(Collection<T> s)
public static <T1,T2> Map<T1,T2> newMap()
public static <T1,T2> Map<T1,T2> newMap(Map<T1,T2> m)
public static <T1,T2,T3> Map<T1,Map<T2,Set<T3>>> newMapMapSet(Map<T1,Map<T2,Set<T3>>> m)
public static <T1,T2> Map<T1,Set<T2>> newMapSet(Map<T1,Set<T2>> m)
public static <T> Queue<T> newQueue()
public static <T> Set<T> newSet()
public static <T> Set<T> newSet(Collection<T> s)
public static <T> Set<T> singleton(T t)
newSet()), unlike java.util.Collections.singleton.public static <K extends Comparable<K>,V> TreeSet<Map.Entry<K,V>> sortedEntries(Map<K,V> m)
Copyright © 2012 Aarhus University