MCPcopy Index your code
hub / github.com/antlr/codebuff / uniqueIndex

Method uniqueIndex

output/java_guava/1.4.17/Maps.java:1235–1239  ·  view source on GitHub ↗

Returns a map with the given values, indexed by keys derived from those values. In other words, each input value produces an entry in the map whose key is the result of applying keyFunction to that value. These entries appear in the same order as the input values. Example usage: <pre

(Iterable<V> values, Function<? super V, K> keyFunction)

Source from the content-addressed store, hash-verified

1233 */
1234
1235 @CanIgnoreReturnValue
1236 public static <K, V> ImmutableMap<K, V> uniqueIndex(Iterable<V> values, Function<? super V, K> keyFunction) {
1237 // TODO(lowasser): consider presizing the builder if values is a Collection
1238 return uniqueIndex(values.iterator(), keyFunction);
1239 }
1240
1241 /**
1242 * Returns a map with the given {@code values}, indexed by keys derived from

Callers 1

uniqueIndexMethod · 0.95

Calls 9

builderMethod · 0.95
iteratorMethod · 0.65
nextMethod · 0.65
putMethod · 0.65
applyMethod · 0.65
checkNotNullMethod · 0.45
hasNextMethod · 0.45
buildMethod · 0.45
getMessageMethod · 0.45

Tested by

no test coverage detected