V
- type of mapped valuespublic class ClassMap<V> extends Object implements Map<Class<?>,V>
map.put(A.class, "any A");
String s = map.get(B.class);
returns "any A" since B extends A. Null keys aren't allowed.Constructor and Description |
---|
ClassMap() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<Class<?>,V>> |
entrySet() |
V |
get(Object key) |
boolean |
isEmpty() |
Set<Class<?>> |
keySet() |
V |
put(Class<?> key,
V value) |
void |
putAll(Map<? extends Class<?>,? extends V> m) |
V |
remove(Object key) |
int |
size() |
Collection<V> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public boolean containsKey(Object key)
containsKey
in interface Map<Class<?>,V>
public boolean containsValue(Object value)
containsValue
in interface Map<Class<?>,V>