K
- 键类型V
- 值类型public class TableMap<K,V> extends Object implements Map<K,V>, Iterable<Map.Entry<K,V>>, Serializable
Constructor and Description |
---|
TableMap(int size)
构造
|
TableMap(K[] keys,
V[] values)
构造
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
K |
getKey(V value)
根据value获得对应的key,只返回找到的第一个value对应的key值
|
List<K> |
getKeys(V value)
获取指定value对应的所有key
|
List<V> |
getValues(K key)
获取指定key对应的所有值
|
boolean |
isEmpty() |
Iterator<Map.Entry<K,V>> |
iterator() |
Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
remove(Object key) |
int |
size() |
String |
toString() |
Collection<V> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
forEach, spliterator
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
public K getKey(V value)
value
- 值public List<V> getValues(K key)
key
- 键public List<K> getKeys(V value)
value
- 值Copyright © 2021. All rights reserved.