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> static <K,
E, V extends Collection<E>, M extends Multimap<K, E, V>>
Mconcat
(Map<? extends K, ? extends E> a, Map<? extends K, ? extends E> b, IntFunction<? extends M> multimapSupplier) Deprecated.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) static <K,
E, V extends Collection<E>, M extends Multimap<K, E, V>>
Mconcat
(Map<? extends K, ? extends E> a, Map<? extends K, ? extends E> b, Map<? extends K, ? extends E> c, IntFunction<? extends M> multimapSupplier) Deprecated.copy()
<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.static <K,
E> SetMultimap<E, K> flatInvertFrom
(Map<K, ? extends Collection<? extends E>> map) Flat invert from.static <K,
E, V extends Collection<K>, M extends Multimap<E, K, V>>
MflatInvertFrom
(Map<K, ? extends Collection<? extends E>> map, IntFunction<? extends M> multimapSupplier) Deprecated.static <T,
K, X extends Exception>
SetMultimap<K,T> from
(Collection<? extends T> c, Throwables.Function<? super T, ? extends K, X> keyMapper) static <T,
K, E, X extends Exception, X2 extends Exception>
SetMultimap<K,E> from
(Collection<? extends T> c, Throwables.Function<? super T, ? extends K, X> keyMapper, Throwables.Function<? super T, ? extends E, X2> valueExtractor) static <T,
K, E, V extends Collection<E>, M extends Multimap<K, E, V>, X extends Exception, X2 extends Exception>
Mfrom
(Collection<? extends T> c, Throwables.Function<? super T, ? extends K, X> keyMapper, Throwables.Function<? super T, ? extends E, X2> valueExtractor, IntFunction<? extends M> multimapSupplier) Deprecated.static <T,
K, V extends Collection<T>, M extends Multimap<K, T, V>, X extends Exception>
Mfrom
(Collection<? extends T> c, Throwables.Function<? super T, ? extends K, X> keyMapper, IntFunction<? extends M> multimapSupplier) Deprecated.static <K,
E> SetMultimap<K, E> static <K,
E, V extends Collection<E>, M extends Multimap<K, E, V>>
Mfrom
(Map<? extends K, ? extends E> map, IntFunction<? extends M> multimapSupplier) Deprecated.static <K,
E> SetMultimap<K, E> fromm
(Map<? extends K, ? extends Collection<? extends E>> map) static <K,
E, V extends Collection<E>, M extends Multimap<K, E, V>>
Mfromm
(Map<? extends K, ? extends Collection<? extends E>> map, IntFunction<? extends M> multimapSupplier) Deprecated.static <K,
E, V extends Collection<E>>
SetMultimap<E,K> invertFrom
(Multimap<K, E, V> map) static <K,
E, V extends Collection<E>, VV extends Collection<K>, M extends Multimap<E, K, VV>>
MinvertFrom
(Multimap<K, E, V> multimap, IntFunction<? extends M> multimapSupplier) Deprecated.static <K,
E> SetMultimap<E, K> invertFrom
(Map<K, E> map) static <K,
E, V extends Collection<K>, M extends Multimap<E, K, V>>
MinvertFrom
(Map<K, E> map, IntFunction<? extends M> multimapSupplier) Deprecated.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 Collection<E>>
Multimap<K,E, V> Deprecated.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, replaceAll, replaceAllIf, replaceAllIf, replaceAllIf, replaceAllIf, replaceIf, replaceIf, 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:
-
from
- Type Parameters:
K
- the key typeE
-- Parameters:
map
-- Returns:
-
fromm
@Beta public static <K,E> SetMultimap<K,E> fromm(Map<? extends K, ? extends Collection<? extends E>> map) - Type Parameters:
K
- the key typeE
-- Parameters:
map
-- Returns:
-
from
public static <T,K, SetMultimap<K,X extends Exception> T> from(Collection<? extends T> c, Throwables.Function<? super T, ? extends K, throws XX> keyMapper) - Type Parameters:
T
-K
- the key typeX
-- Parameters:
c
-keyMapper
-- Returns:
- Throws:
X
- the x
-
from
public static <T,K, SetMultimap<K,E, X extends Exception, X2 extends Exception> E> from(Collection<? extends T> c, Throwables.Function<? super T, ? extends K, throws X, X2X> keyMapper, Throwables.Function<? super T, ? extends E, X2> valueExtractor) - Type Parameters:
T
-K
- the key typeE
-X
-X2
-- Parameters:
c
-keyMapper
-valueExtractor
-- Returns:
- Throws:
X
- the xX2
- the x2
-
invertFrom
- Type Parameters:
K
- the key typeE
-- Parameters:
map
-- Returns:
- See Also:
-
Multimap#invertFrom(Map, Supplier)
-
flatInvertFrom
Flat invert from.- Type Parameters:
K
- the key typeE
-- Parameters:
map
-- Returns:
- See Also:
-
Multimap#flatInvertFrom(Map, Supplier)
-
invertFrom
- Type Parameters:
K
- the key typeE
-V
- the value type- Parameters:
map
-- 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:
-
wrap
- Type Parameters:
K
- the key typeE
-V
- the value type- Parameters:
map
-- Returns:
-
wrapp
public static <K,E, SetMultimap<K,V extends Set<E>> E> wrapp(Map<K, V> map, Supplier<? extends V> valueSupplier) - Type Parameters:
K
- the key typeE
-V
- the value type- Parameters:
map
-valueSupplier
-- Returns:
-
from
@Deprecated public static <K,E, M fromV extends Collection<E>, M extends Multimap<K, E, V>> (Map<? extends K, ? extends E> map, IntFunction<? extends M> multimapSupplier) throws UnsupportedOperationExceptionDeprecated.- Type Parameters:
K
- the key typeE
-V
- the value typeM
-- Parameters:
map
-multimapSupplier
-- Returns:
- Throws:
UnsupportedOperationException
-
fromm
@Deprecated public static <K,E, M frommV extends Collection<E>, M extends Multimap<K, E, V>> (Map<? extends K, ? extends Collection<? extends E>> map, IntFunction<? extends M> multimapSupplier) throws UnsupportedOperationExceptionDeprecated.- Type Parameters:
K
- the key typeE
-V
- the value typeM
-- Parameters:
map
-multimapSupplier
-- Returns:
- Throws:
UnsupportedOperationException
-
from
@Deprecated public static <T,K, M fromV extends Collection<T>, M extends Multimap<K, T, V>, X extends Exception> (Collection<? extends T> c, Throwables.Function<? super T, ? extends K, throws XX> keyMapper, IntFunction<? extends M> multimapSupplier) Deprecated.- Type Parameters:
T
-K
- the key typeV
- the value typeM
-X
-- Parameters:
c
-keyMapper
-multimapSupplier
-- Returns:
- Throws:
X
- the x
-
from
@Deprecated public static <T,K, M fromE, V extends Collection<E>, M extends Multimap<K, E, V>, X extends Exception, X2 extends Exception> (Collection<? extends T> c, Throwables.Function<? super T, ? extends K, throws X, X2X> keyMapper, Throwables.Function<? super T, ? extends E, X2> valueExtractor, IntFunction<? extends M> multimapSupplier) Deprecated.- Type Parameters:
T
-K
- the key typeE
-V
- the value typeM
-X
-X2
-- Parameters:
c
-keyMapper
-valueExtractor
-multimapSupplier
-- Returns:
- Throws:
X
- the xX2
- the x2
-
invertFrom
@Deprecated public static <K,E, M invertFromV extends Collection<K>, M extends Multimap<E, K, V>> (Map<K, E> map, IntFunction<? extends M> multimapSupplier) throws UnsupportedOperationExceptionDeprecated.- Type Parameters:
K
- the key typeE
-V
- the value typeM
-- Parameters:
map
-multimapSupplier
-- Returns:
- Throws:
UnsupportedOperationException
-
flatInvertFrom
@Deprecated public static <K,E, M flatInvertFromV extends Collection<K>, M extends Multimap<E, K, V>> (Map<K, ? extends Collection<? extends E>> map, IntFunction<? extends M> multimapSupplier) throws UnsupportedOperationExceptionDeprecated.Flat invert from.- Type Parameters:
K
- the key typeE
-V
- the value typeM
-- Parameters:
map
-multimapSupplier
-- Returns:
- Throws:
UnsupportedOperationException
-
invertFrom
@Deprecated public static <K,E, M invertFromV extends Collection<E>, VV extends Collection<K>, M extends Multimap<E, K, VV>> (Multimap<K, E, throws UnsupportedOperationExceptionV> multimap, IntFunction<? extends M> multimapSupplier) Deprecated.- Type Parameters:
K
- the key typeE
-V
- the value typeVV
-M
-- Parameters:
multimap
-multimapSupplier
-- Returns:
- Throws:
UnsupportedOperationException
-
concat
@Deprecated public static <K,E, M concatV extends Collection<E>, M extends Multimap<K, E, V>> (Map<? extends K, ? extends E> a, Map<? extends K, throws UnsupportedOperationException? extends E> b, IntFunction<? extends M> multimapSupplier) Deprecated.- Type Parameters:
K
- the key typeE
-V
- the value typeM
-- Parameters:
a
-b
-multimapSupplier
-- Returns:
- Throws:
UnsupportedOperationException
-
concat
@Deprecated public static <K,E, M concatV extends Collection<E>, M extends Multimap<K, E, V>> (Map<? extends K, ? extends E> a, Map<? extends K, throws UnsupportedOperationException? extends E> b, Map<? extends K, ? extends E> c, IntFunction<? extends M> multimapSupplier) Deprecated.- Type Parameters:
K
- the key typeE
-V
- the value typeM
-- Parameters:
a
-b
-c
-multimapSupplier
-- Returns:
- Throws:
UnsupportedOperationException
-
wrap
@Deprecated public static <K,E, Multimap<K,V extends Collection<E>> E, wrapV> (Map<K, V> map, Supplier<? extends V> valueSupplier) throws UnsupportedOperationExceptionDeprecated.- Type Parameters:
K
- the key typeE
-V
- the value type- Parameters:
map
-valueSupplier
-- Returns:
- Throws:
UnsupportedOperationException
-
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) -
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:
-