public class MultiMaps extends Object
| Constructor and Description |
|---|
MultiMaps() |
| Modifier and Type | Method and Description |
|---|---|
static <K,V> void |
addAllKeys(Map<K,Set<V>> map,
Iterable<K> keys) |
static <K,V> Set<V> |
addKey(Map<K,Set<V>> map,
K key) |
static <K,V> boolean |
containsEntry(Map<K,Set<V>> map,
K key,
V value) |
static <K,V> Map<K,Set<V>> |
copy(Map<K,Set<V>> source) |
static <T> Set<T> |
getCommonParent(Map<T,? extends Collection<T>> map,
T a,
T b)
Find the nearest set of nodes that are parents of both given nodes.
|
static <K,V> void |
put(Map<K,Set<V>> map,
K key,
V value) |
static <K,V> void |
putAll(Map<K,Set<V>> map,
K key,
Collection<? extends V> vs) |
static <K,V> void |
putAll(Map<K,Set<V>> target,
Map<? extends K,? extends Set<? extends V>> source) |
static <K,V> Map<V,Set<K>> |
reverse(Map<K,Set<V>> source)
Creates a new map that is the reverse of the source
|
static <K,V> Set<V> |
safeGet(Map<K,? extends Collection<V>> map,
Object key)
This method returns an empty set (Collections.emptySet) for keys that are not in the map.
|
static <K,V> Set<V> |
safeGetAll(Map<K,? extends Collection<V>> map,
Collection<?> keys)
Returns the set of successors for a given set of keys
|
static <K,V> Collection<V> |
safeGetC(Map<K,? extends Collection<V>> map,
Object key)
TODO Add to collection utils
|
static <T> Map<T,Set<T>> |
transitiveClosure(Map<T,Set<T>> map) |
static <T> Map<T,Set<T>> |
transitiveClosure(Map<T,Set<T>> map,
boolean inPlace) |
static <T> Map<T,Set<T>> |
transitiveClosureInPlace(Map<T,Set<T>> map) |
static <T> Set<T> |
transitiveGet(Map<T,? extends Collection<T>> map,
Object key) |
static <K,V> Collection<V> |
values(Map<K,Set<V>> map) |
public static <K,V> void putAll(Map<K,Set<V>> target, Map<? extends K,? extends Set<? extends V>> source)
public static <K,V> void putAll(Map<K,Set<V>> map, K key, Collection<? extends V> vs)
public static <K,V> Collection<V> values(Map<K,Set<V>> map)
public static <K,V> Map<V,Set<K>> reverse(Map<K,Set<V>> source)
K - V - source - public static <K,V> Set<V> safeGet(Map<K,? extends Collection<V>> map, Object key)
K - V - map - key - public static <K,V> Set<V> safeGetAll(Map<K,? extends Collection<V>> map, Collection<?> keys)
K - V - map - keys - public static <K,V> Collection<V> safeGetC(Map<K,? extends Collection<V>> map, Object key)
K - V - map - key - public static <T> Set<T> transitiveGet(Map<T,? extends Collection<T>> map, Object key)
public static <T> Map<T,Set<T>> transitiveClosure(Map<T,Set<T>> map, boolean inPlace)
public static <T> Map<T,Set<T>> transitiveClosureInPlace(Map<T,Set<T>> map)
public static <T> Set<T> getCommonParent(Map<T,? extends Collection<T>> map, T a, T b)
map - A mapping from children to parentsa - b - Copyright © 2015. All rights reserved.