Package org.aoju.bus.core.map
Class DuplexingMap<K,V>
java.lang.Object
org.aoju.bus.core.map.MapWrapper<K,V>
org.aoju.bus.core.map.DuplexingMap<K,V>
- Type Parameters:
K- 键类型V- 值类型
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Map.Entry<K,,V>> Map<K,,V> XWrapper<Map<K,V>>
双向Map 互换键值对不检查值是否有重复,如果有则后加入的元素替换先加入的元素 值的顺序在HashMap中不确定,所以谁覆盖谁也不确定,在有序的Map中按照先后顺序覆盖,保留最后的值
它与TableMap的区别是,BiMap维护两个Map实现高效的正向和反向查找
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.aoju.bus.core.map.MapWrapper
DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) 获取反向Map根据值获得键voidputIfAbsent(K key, V value) booleanMethods inherited from class org.aoju.bus.core.map.MapWrapper
clone, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, getRaw, hashCode, isEmpty, iterator, keySet, replace, replace, replaceAll, size, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DuplexingMap
-
-
Method Details
-
put
-
putAll
-
remove
-
remove
-
clear
-
getInverse
-
getKey
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceMap<K,V> - Overrides:
putIfAbsentin classMapWrapper<K,V>
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceMap<K,V> - Overrides:
computeIfAbsentin classMapWrapper<K,V>
-
computeIfPresent
- Specified by:
computeIfPresentin interfaceMap<K,V> - Overrides:
computeIfPresentin classMapWrapper<K,V>
-
compute
-
merge
-