Package org.aoju.bus.core.map
Class TableMap<K,V>
java.lang.Object
org.aoju.bus.core.map.TableMap<K,V>
- Type Parameters:
K- 键类型V- 值类型
- All Implemented Interfaces:
Serializable,Iterable<Map.Entry<K,,V>> Map<K,V>
public class TableMap<K,V>
extends Object
implements Map<K,V>, Iterable<Map.Entry<K,V>>, Serializable
无重复键的Map
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
TableMap
public TableMap()构造 -
TableMap
public TableMap(int size) 构造- Parameters:
size- 初始容量
-
TableMap
构造- Parameters:
keys- 键列表values- 值列表
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
get
-
getKey
根据value获得对应的key,只返回找到的第一个value对应的key值- Parameters:
value- 值- Returns:
- 键
-
getValues
获取指定key对应的所有值- Parameters:
key- 键- Returns:
- 值列表
-
getKeys
获取指定value对应的所有key- Parameters:
value- 值- Returns:
- 值列表
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
keys
获取所有键,可重复,不可修改- Returns:
- 键列表
-
values
-
entrySet
-
iterator
-
toString
-