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

Method indexMap

corpus/java/training/guava/collect/Maps.java:4134–4141  ·  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

4132 * Returns a map from the ith element of list to i.
4133 */
4134 static <E> ImmutableMap<E, Integer> indexMap(Collection<E> list) {
4135 ImmutableMap.Builder<E, Integer> builder = new ImmutableMap.Builder<E, Integer>(list.size());
4136 int i = 0;
4137 for (E e : list) {
4138 builder.put(e, i++);
4139 }
4140 return builder.build();
4141 }
4142
4143 /**
4144 * 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