Class MultiMap<K,V>
java.lang.Object
cool.scx.collections.multi_map.MultiMap<K,V>
- All Implemented Interfaces:
IMultiMap<K,,V> Iterable<IMultiMapEntry<K,V>>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidbooleanadd(K key, Collection<? extends V> values) booleanbooleanvoidclear()booleancontainsKey(K key) booleancontainsValue(V value) final boolean<X extends Throwable>
void<X extends Throwable>
voidforEachEntry(cool.scx.function.BiConsumerX<? super K, List<V>, X> action) 获取首个值获取所有值inthashCode()booleanisEmpty()iterator()keys()booleanremove(K key, Collection<? extends V> values) booleanbooleanvoidvoidset(K key, Collection<? extends V> values) longsize()返回 MultiMap 中所有键对应的所有值的总数量 (即所有 values 的扁平总和)toSingleValueMap(Supplier<Map<K, V>> mapSupplier) toString()values()返回 MultiMap 中所有值的扁平集合 (所有键对应的 values 合并成一个列表)Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
MultiMap
public MultiMap()默认内部 map 使用 HashMap, list 使用 ArrayList -
MultiMap
-
-
Method Details
-
add
-
add
-
add
-
add
-
add
-
set
-
set
-
set
-
set
-
set
-
get
-
getAll
-
containsKey
- Specified by:
containsKeyin interfaceIMultiMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceIMultiMap<K,V>
-
remove
-
remove
-
remove
-
removeAll
-
keys
-
values
-
size
-
isEmpty
-
clear
-
toMultiValueMap
-
toSingleValueMap
-
toSingleValueMap
-
forEach
-
forEachEntry
-
iterator
-
equals
-
hashCode
-
toString
-