public final class Multimaps extends Object
| Modifier and Type | Method and Description |
|---|---|
static <K> Set<K> |
getLargeGroups(com.google.common.collect.Multimap<K,?> map,
int minSize)
Returns the set of keys associated with groups of a size greater than or equal to a given size.
|
static <K> Set<K> |
getLargestGroups(com.google.common.collect.Multimap<K,?> map,
int topValues)
Returns the set of keys associated with the largest values in the multimap.
|
static <K,V> com.google.common.collect.Multimap<K,V> |
prune(com.google.common.collect.Multimap<K,V> map,
int minSize)
Convenience method to prune key/values pairs where the size of the value collection is below a
threshold.
|
static <K,V> com.google.common.collect.Multimap<K,V> |
prune(com.google.common.collect.Multimap<K,V> map,
com.google.common.base.Predicate<Collection<V>> filterRule)
Prunes a multimap based on a predicate, returning the pruned values.
|
public static <K,V> com.google.common.collect.Multimap<K,V> prune(com.google.common.collect.Multimap<K,V> map,
com.google.common.base.Predicate<Collection<V>> filterRule)
K - The key type in the multimap.V - The value type in the multimap.map - The multimap to prune.filterRule - The pruning rule. When the predicate returns false for an entry, it
will be pruned, otherwise it will be retained.public static <K,V> com.google.common.collect.Multimap<K,V> prune(com.google.common.collect.Multimap<K,V> map,
int minSize)
K - The key type in the multimap.V - The value type in the multimap.map - The multimap to prune.minSize - The minimum size for retained value collections.public static <K> Set<K> getLargeGroups(com.google.common.collect.Multimap<K,?> map, int minSize)
K - The key type for the multimap.map - The multimap to search.minSize - The minimum size to return associated keys for.minSize.public static <K> Set<K> getLargestGroups(com.google.common.collect.Multimap<K,?> map, int topValues)
map - The multimap to search.topValues - Number of groupings to find the keys for.topValues.