MCPcopy Create free account
hub / github.com/antlr/codebuff / inferKeyType

Method inferKeyType

output/java_guava/1.4.19/EnumBiMap.java:88–97  ·  view source on GitHub ↗
(Map<K, ?> map)

Source from the content-addressed store, hash-verified

86
87
88 static <K extends Enum<K>> Class<K> inferKeyType(Map<K, ?> map) {
89 if (map instanceof EnumBiMap) {
90 return ((EnumBiMap<K, ?>) map).keyType();
91 }
92 if (map instanceof EnumHashBiMap) {
93 return ((EnumHashBiMap<K, ?>) map).keyType();
94 }
95 checkArgument(!map.isEmpty());
96 return map.keySet().iterator().next().getDeclaringClass();
97 }
98
99 private static <V extends Enum<V>> Class<V> inferValueType(Map<?, V> map) {
100 if (map instanceof EnumBiMap) {

Callers 2

createMethod · 0.95
createMethod · 0.95

Calls 7

isEmptyMethod · 0.65
nextMethod · 0.65
iteratorMethod · 0.65
keySetMethod · 0.65
keyTypeMethod · 0.45
checkArgumentMethod · 0.45
getDeclaringClassMethod · 0.45

Tested by

no test coverage detected