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

Method pairs

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

Given a list with N elements [e 0 , e 1 , ..., e N-1 ] (where N is even), returns a list of the N / 2 elements [ (e 0 , e 1 ), (e 2 , e 3 ), ... ].

(final List<E> list)

Source from the content-addressed store, hash-verified

2116 * [ (e<sub>0</sub>, e<sub>1</sub>),
2117 * (e<sub>2</sub>, e<sub>3</sub>), ... ]. */
2118 public static <E> List<Pair<E, E>> pairs(final List<E> list) {
2119 return Pair.zip(quotientList(list, 2, 0),
2120 quotientList(list, 2, 1));
2121 }
2122
2123 /** Returns the first value if it is not null,
2124 * otherwise the second value.

Callers 3

testQuotientListMethod · 0.95
pairsMethod · 0.95
frameMethod · 0.45

Calls 2

zipMethod · 0.95
quotientListMethod · 0.95

Tested by 1

testQuotientListMethod · 0.76