Class MultiMap<K,V>
java.lang.Object
cool.scx.common.util.MultiMap<K,V>
- Type Parameters:
K- KeyV- Value
- All Implemented Interfaces:
MultiMapInterface<K,,V> Iterable<Map.Entry<K,List<V>>>
MultiMap
- Version:
- 0.0.1
- Author:
- scx567888
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(MultiMapInterface<? extends K, ? extends V> map) voidbooleanadd(K key, Collection<? extends V> values) booleanbooleanvoidclear()booleancontainsKey(K key) booleancontainsValue(V value) voidforEach(BiConsumer<? super K, V> action) booleanisEmpty()iterator()keys()booleanremove(K key, Collection<? extends V> values) booleanbooleanvoidset(MultiMapInterface<? extends K, ? extends V> map) voidset(K key, Collection<? extends V> values) longsize()toSingleValueMap(Supplier<Map<K, V>> mapSupplier) toString()values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
MultiMap
-
MultiMap
public MultiMap()默认内部 map 使用 HashMap, key 使用 ArrayList
-
-
Method Details
-
add
-
add
-
add
- Specified by:
addin interfaceMultiMapInterface<K,V>
-
add
-
add
- Specified by:
addin interfaceMultiMapInterface<K,V>
-
set
-
set
-
set
- Specified by:
setin interfaceMultiMapInterface<K,V>
-
set
-
set
- Specified by:
setin interfaceMultiMapInterface<K,V>
-
get
-
getAll
-
containsKey
- Specified by:
containsKeyin interfaceMultiMapInterface<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMultiMapInterface<K,V>
-
remove
-
remove
-
remove
- Specified by:
removein interfaceMultiMapInterface<K,V>
-
removeAll
-
keys
-
values
-
size
public long size()- Specified by:
sizein interfaceMultiMapInterface<K,V>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceMultiMapInterface<K,V>
-
clear
public void clear()- Specified by:
clearin interfaceMultiMapInterface<K,V>
-
toMultiValueMap
- Specified by:
toMultiValueMapin interfaceMultiMapInterface<K,V>
-
toSingleValueMap
- Specified by:
toSingleValueMapin interfaceMultiMapInterface<K,V>
-
toSingleValueMap
-
forEach
- Specified by:
forEachin interfaceMultiMapInterface<K,V>
-
iterator
-
toString
-