Package com.landawn.abacus.util
Class SetMultimap<K,E>
java.lang.Object
com.landawn.abacus.util.Multimap<K,E,Set<E>>
com.landawn.abacus.util.SetMultimap<K,E>
- Type Parameters:
K
- the key typeE
-
- Since:
- 0.9
- Author:
- Haiyang Li
- See Also:
-
CommonUtil.newSetMultimap()
CommonUtil.newSetMultimap(Class, Class)
CommonUtil.newSetMultimap(Supplier, Supplier)
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
E> SetMultimap<K, E> concat
(Collection<? extends Map<? extends K, ? extends E>> c) static <K,
E> SetMultimap<K, E> static <K,
E> SetMultimap<K, E> concat
(Map<? extends K, ? extends E> a, Map<? extends K, ? extends E> b, Map<? extends K, ? extends E> c) copy()
static <T,
K> SetMultimap<K, T> create
(Collection<? extends T> c, Function<? super T, ? extends K> keyMapper) static <T,
K, E> SetMultimap<K, E> create
(Collection<? extends T> c, Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends E> valueExtractor) static <K,
E> SetMultimap<K, E> Create a newSetMultimap
with the keys/values from the specifiedmap
.<X extends Exception>
SetMultimap<K,E> filter
(Throwables.BiPredicate<? super K, ? super Set<E>, X> filter) <X extends Exception>
SetMultimap<K,E> filterByKey
(Throwables.Predicate<? super K, X> filter) Filter by key.<X extends Exception>
SetMultimap<K,E> filterByValue
(Throwables.Predicate<? super Set<E>, X> filter) Filter by value.inverse()
static <K,
E> SetMultimap<K, E> of
(K k1, E v1) static <K,
E> SetMultimap<K, E> of
(K k1, E v1, K k2, E v2) static <K,
E> SetMultimap<K, E> of
(K k1, E v1, K k2, E v2, K k3, E v3) static <K,
E> SetMultimap<K, E> of
(K k1, E v1, K k2, E v2, K k3, E v3, K k4, E v4) static <K,
E> SetMultimap<K, E> of
(K k1, E v1, K k2, E v2, K k3, E v3, K k4, E v4, K k5, E v5) static <K,
E> SetMultimap<K, E> of
(K k1, E v1, K k2, E v2, K k3, E v3, K k4, E v4, K k5, E v5, K k6, E v6) static <K,
E> SetMultimap<K, E> of
(K k1, E v1, K k2, E v2, K k3, E v3, K k4, E v4, K k5, E v5, K k6, E v6, K k7, E v7) To immutable map.toImmutableMap
(IntFunction<? extends Map<K, ImmutableSet<E>>> mapSupplier) To immutable map.static <K,
E, V extends Set<E>>
SetMultimap<K,E> static <K,
E, V extends Set<E>>
SetMultimap<K,E> Methods inherited from class com.landawn.abacus.util.Multimap
accept, acceptIfNotEmpty, apply, applyIfNotEmpty, clear, compute, computeIfAbsent, computeIfPresent, contains, containsAll, containsKey, containsValue, entrySet, entryStream, equals, flatForEach, flatForEachValue, flatValues, flatValues, forEach, forEachKey, forEachValue, get, getOrDefault, hashCode, inverse, isEmpty, keySet, merge, merge, put, putAll, putAll, putAll, putAllIfKeyAbsent, putIfAbsent, putIfKeyAbsent, remove, removeAll, removeAll, removeAll, removeAll, removeAllIf, removeAllIf, removeAllIf, removeAllIf, removeIf, removeIf, replace, replaceAll, replaceAll, replaceAllIf, replaceAllIf, replaceIf, replaceIf, replaceManyWithOne, replaceManyWithOneIf, replaceManyWithOneIf, size, stream, toMap, toMap, toMultiset, toString, totalCountOfValues, unwrap, values
-
Method Details
-
of
- Type Parameters:
K
- the key typeE
-- Parameters:
k1
-v1
-- Returns:
-
of
- Type Parameters:
K
- the key typeE
-- Parameters:
k1
-v1
-k2
-v2
-- Returns:
-
of
- Type Parameters:
K
- the key typeE
-- Parameters:
k1
-v1
-k2
-v2
-k3
-v3
-- Returns:
-
of
- Type Parameters:
K
- the key typeE
-- Parameters:
k1
-v1
-k2
-v2
-k3
-v3
-k4
-v4
-- Returns:
-
of
public static <K,E> SetMultimap<K,E> of(K k1, E v1, K k2, E v2, K k3, E v3, K k4, E v4, K k5, E v5) - Type Parameters:
K
- the key typeE
-- Parameters:
k1
-v1
-k2
-v2
-k3
-v3
-k4
-v4
-k5
-v5
-- Returns:
-
of
public static <K,E> SetMultimap<K,E> of(K k1, E v1, K k2, E v2, K k3, E v3, K k4, E v4, K k5, E v5, K k6, E v6) - Type Parameters:
K
- the key typeE
-- Parameters:
k1
-v1
-k2
-v2
-k3
-v3
-k4
-v4
-k5
-v5
-k6
-v6
-- Returns:
-
of
public static <K,E> SetMultimap<K,E> of(K k1, E v1, K k2, E v2, K k3, E v3, K k4, E v4, K k5, E v5, K k6, E v6, K k7, E v7) - Type Parameters:
K
- the key typeE
-- Parameters:
k1
-v1
-k2
-v2
-k3
-v3
-k4
-v4
-k5
-v5
-k6
-v6
-k7
-v7
-- Returns:
-
create
Create a newSetMultimap
with the keys/values from the specifiedmap
.- Type Parameters:
K
- the key typeE
-- Parameters:
map
-- Returns:
-
create
public static <T,K> SetMultimap<K,T> create(Collection<? extends T> c, Function<? super T, ? extends K> keyMapper) - Type Parameters:
T
-K
- the key type- Parameters:
c
-keyMapper
-- Returns:
-
create
public static <T,K, SetMultimap<K,E> E> create(Collection<? extends T> c, Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends E> valueExtractor) - Type Parameters:
T
-K
- the key typeE
-- Parameters:
c
-keyMapper
-valueExtractor
-- Returns:
-
concat
public static <K,E> SetMultimap<K,E> concat(Map<? extends K, ? extends E> a, Map<? extends K, ? extends E> b) - Type Parameters:
K
- the key typeE
-- Parameters:
a
-b
-- Returns:
-
concat
public static <K,E> SetMultimap<K,E> concat(Map<? extends K, ? extends E> a, Map<? extends K, ? extends E> b, Map<? extends K, ? extends E> c) - Type Parameters:
K
- the key typeE
-- Parameters:
a
-b
-c
-- Returns:
-
concat
- Type Parameters:
K
-E
-- Parameters:
c
-- Returns:
-
wrap
- Type Parameters:
K
- the key typeE
-V
- the value type- Parameters:
map
-- Returns:
-
wrap
public static <K,E, SetMultimap<K,V extends Set<E>> E> wrap(Map<K, V> map, Supplier<? extends V> valueSupplier) - Type Parameters:
K
- the key typeE
-V
- the value type- Parameters:
map
-valueSupplier
-- Returns:
-
filterByKey
public <X extends Exception> SetMultimap<K,E> filterByKey(Throwables.Predicate<? super K, X> filter) throws XFilter by key. -
filterByValue
public <X extends Exception> SetMultimap<K,E> filterByValue(Throwables.Predicate<? super Set<E>, X> filter) throws XFilter by value. -
filter
public <X extends Exception> SetMultimap<K,E> filter(Throwables.BiPredicate<? super K, ? super Set<E>, throws XX> filter) -
inverse
- Returns:
-
copy
-
toImmutableMap
To immutable map.- Returns:
-
toImmutableMap
public ImmutableMap<K,ImmutableSet<E>> toImmutableMap(IntFunction<? extends Map<K, ImmutableSet<E>>> mapSupplier) To immutable map.- Parameters:
mapSupplier
-- Returns:
-