Package com.landawn.abacus.util
Class ListMultimap<K,E>
java.lang.Object
com.landawn.abacus.util.Multimap<K,E,List<E>>
com.landawn.abacus.util.ListMultimap<K,E>
- Type Parameters:
K
- the key typeE
-
- Since:
- 0.9
- Author:
- Haiyang Li
- See Also:
-
CommonUtil.newListMultimap()
CommonUtil.newListMultimap(Class, Class)
CommonUtil.newListMultimap(Supplier, Supplier)
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
E> ListMultimap<K, E> concat
(Collection<? extends Map<? extends K, ? extends E>> c) static <K,
E> ListMultimap<K, E> static <K,
E> ListMultimap<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> ListMultimap<K, T> create
(Collection<? extends T> c, Function<? super T, ? extends K> keyMapper) static <T,
K, E> ListMultimap<K, E> create
(Collection<? extends T> c, Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends E> valueExtractor) static <K,
E> ListMultimap<K, E> Create a newListMultimap
with the keys/values from the specifiedmap
.<X extends Exception>
ListMultimap<K,E> filter
(Throwables.BiPredicate<? super K, ? super List<E>, X> filter) <X extends Exception>
ListMultimap<K,E> filterByKey
(Throwables.Predicate<? super K, X> filter) Filter by key.<X extends Exception>
ListMultimap<K,E> filterByValue
(Throwables.Predicate<? super List<E>, X> filter) Filter by value.inverse()
static <K,
E> ListMultimap<K, E> of
(K k1, E v1) static <K,
E> ListMultimap<K, E> of
(K k1, E v1, K k2, E v2) static <K,
E> ListMultimap<K, E> of
(K k1, E v1, K k2, E v2, K k3, E v3) static <K,
E> ListMultimap<K, E> of
(K k1, E v1, K k2, E v2, K k3, E v3, K k4, E v4) static <K,
E> ListMultimap<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> ListMultimap<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> ListMultimap<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, ImmutableList<E>>> mapSupplier) To immutable map.static <K,
E, V extends List<E>>
ListMultimap<K,E> static <K,
E, V extends List<E>>
ListMultimap<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> ListMultimap<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> ListMultimap<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> ListMultimap<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 newListMultimap
with the keys/values from the specifiedmap
.- Type Parameters:
K
- the key typeE
-- Parameters:
map
-- Returns:
-
create
public static <T,K> ListMultimap<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, ListMultimap<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> ListMultimap<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> ListMultimap<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, ListMultimap<K,V extends List<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> ListMultimap<K,E> filterByKey(Throwables.Predicate<? super K, X> filter) throws XFilter by key. -
filterByValue
public <X extends Exception> ListMultimap<K,E> filterByValue(Throwables.Predicate<? super List<E>, X> filter) throws XFilter by value. -
filter
public <X extends Exception> ListMultimap<K,E> filter(Throwables.BiPredicate<? super K, ? super List<E>, throws XX> filter) -
inverse
- Returns:
-
copy
-
toImmutableMap
To immutable map.- Returns:
-
toImmutableMap
public ImmutableMap<K,ImmutableList<E>> toImmutableMap(IntFunction<? extends Map<K, ImmutableList<E>>> mapSupplier) To immutable map.- Parameters:
mapSupplier
-- Returns:
-