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

Method indexMap

output/java_guava/1.4.17/Maps.java:4201–4208  ·  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

4199
4200
4201 static <E> ImmutableMap<E, Integer> indexMap(Collection<E> list) {
4202 ImmutableMap.Builder<E, Integer> builder = new ImmutableMap.Builder<E, Integer>(list.size());
4203 int i = 0;
4204 for (E e : list) {
4205 builder.put(e, i++);
4206 }
4207 return builder.build();
4208 }
4209
4210 /**
4211 * 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