MCPcopy Create free account
hub / github.com/apache/calcite / transform

Method transform

core/src/main/java/org/apache/calcite/util/Util.java:2749–2758  ·  view source on GitHub ↗

Transforms a list, applying a function to each element.

(List<? extends F> list,
      java.util.function.Function<? super F, ? extends T> function)

Source from the content-addressed store, hash-verified

2747
2748 /** Transforms a list, applying a function to each element. */
2749 public static <F, T> List<T> transform(List<? extends F> list,
2750 java.util.function.Function<? super F, ? extends T> function) {
2751 if (list.isEmpty() && list instanceof ImmutableList) {
2752 return ImmutableList.of(); // save ourselves some effort
2753 } else if (list instanceof RandomAccess) {
2754 return new RandomAccessTransformingList<>(list, function);
2755 } else {
2756 return new TransformingList<>(list, function);
2757 }
2758 }
2759
2760 /** Transforms a list, applying a function to each element, also passing in
2761 * the element's index in the list. */

Callers 15

constantListMethod · 0.95
getQueryMethod · 0.95
toIntervalMethod · 0.95
constantListMethod · 0.95
assertInterpretMethod · 0.95
matchesSafelyMethod · 0.95
leftMethod · 0.95
rightMethod · 0.95
testTransformMethod · 0.95
groupKey_Method · 0.95
setOpMethod · 0.95
convertMethod · 0.95

Calls 2

ofMethod · 0.65
isEmptyMethod · 0.45

Tested by 5

assertInterpretMethod · 0.76
matchesSafelyMethod · 0.76
leftMethod · 0.76
rightMethod · 0.76
testTransformMethod · 0.76