MCPcopy Create free account
hub / github.com/LFYSec/MScan / toMappedCollection

Method toMappedCollection

src/main/java/pascal/taie/util/collection/Views.java:53–57  ·  view source on GitHub ↗

Given a mapper function, creates an immutable view collection for given collection. The elements of the resulting collection are mapped from given collection. @param c the backing collection @param mapper the function maps elements in backing collection to the ones in view

(
            Collection<T> c, Function<T, R> mapper, Predicate<Object> contains)

Source from the content-addressed store, hash-verified

51 * @return an immutable view collection.
52 */
53 public static <T, R> Collection<R> toMappedCollection(
54 Collection<T> c, Function<T, R> mapper, Predicate<Object> contains) {
55 return Collections.unmodifiableCollection(
56 new MappedCollectionView<>(c, mapper, contains));
57 }
58
59 /**
60 * Given a mapper function, creates an immutable view collection

Callers 2

valuesMethod · 0.95
valuesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected