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

Method indexMap

output/java_guava/1.4.19/Maps.java:4205–4212  ·  view source on GitHub ↗

Returns a map from the ith element of list to i.

(Collection<E> list)

Source from the content-addressed store, hash-verified

4203
4204
4205 static <E> ImmutableMap<E, Integer> indexMap(Collection<E> list) {
4206 ImmutableMap.Builder<E, Integer> builder = new ImmutableMap.Builder<E, Integer>(list.size());
4207 int i = 0;
4208 for (E e : list) {
4209 builder.put(e, i++);
4210 }
4211 return builder.build();
4212 }
4213
4214 /**
4215 * Returns a view of the portion of {@code map} whose keys are contained by {@code range}.

Callers 5

ExplicitOrderingMethod · 0.95
DenseImmutableTableMethod · 0.95
SparseImmutableTableMethod · 0.95
ArrayTableMethod · 0.95
PowerSetMethod · 0.95

Calls 3

putMethod · 0.95
buildMethod · 0.95
sizeMethod · 0.65

Tested by

no test coverage detected