K
- 键类型V
- 值类型C
- 集合类型public abstract class AbsCollValueMap<K,V,C extends Collection<V>> extends MapWrapper<K,C>
Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULT_COLLECTION_INITIAL_CAPACITY
默认集合初始大小
|
DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR
Constructor and Description |
---|
AbsCollValueMap()
构造
|
AbsCollValueMap(float loadFactor,
Map<? extends K,C> m)
构造
|
AbsCollValueMap(int initialCapacity)
构造
|
AbsCollValueMap(int initialCapacity,
float loadFactor)
构造
|
AbsCollValueMap(Map<? extends K,C> m)
构造
|
Modifier and Type | Method and Description |
---|---|
protected abstract C |
createCollection()
创建集合
此方法用于创建在putValue后追加值所在的集合,子类实现此方法创建不同类型的集合 |
V |
get(K key,
int index)
获取值
|
void |
putAllValues(Map<? extends K,? extends Collection<V>> m)
放入所有value
|
void |
putValue(K key,
V value)
放入Value
如果键对应值列表有值,加入,否则创建一个新列表后加入 |
boolean |
removeValue(K key,
V value)
移除value集合中的某个值
|
boolean |
removeValues(K key,
Collection<V> values)
移除value集合中的某些值
|
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, getRaw, hashCode, isEmpty, iterator, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected static final int DEFAULT_COLLECTION_INITIAL_CAPACITY
public AbsCollValueMap()
public AbsCollValueMap(int initialCapacity)
initialCapacity
- 初始大小public AbsCollValueMap(float loadFactor, Map<? extends K,C> m)
loadFactor
- 加载因子m
- Mappublic AbsCollValueMap(int initialCapacity, float loadFactor)
initialCapacity
- 初始大小loadFactor
- 加载因子public void putAllValues(Map<? extends K,? extends Collection<V>> m)
m
- valueMappublic void putValue(K key, V value)
key
- 键value
- 值public boolean removeValue(K key, V value)
key
- 键value
- 集合中的某个值public boolean removeValues(K key, Collection<V> values)
key
- 键values
- 集合中的某些值protected abstract C createCollection()
Collection
Copyright © 2024. All rights reserved.