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

Method quotientList

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

Creates a list that returns every nth element of a list, starting at element k. It is OK if the list is empty or its size is not a multiple of n. For instance, quotientList(list, 2, 0) returns the even elements of a list, and quotientList(list, 2, 1) r

(
      final List<E> list, final int n, final int k)

Source from the content-addressed store, hash-verified

2106 * elements. Those lists are the same length only if list has even size.
2107 */
2108 public static <E> List<E> quotientList(
2109 final List<E> list, final int n, final int k) {
2110 return new QuotientList<>(list, n, k);
2111 }
2112
2113 /** Given a list with N elements
2114 * [e<sub>0</sub>, e<sub>1</sub>, ..., e<sub>N-1</sub>]

Callers 7

forEachNameTypeMethod · 0.95
testQuotientListMethod · 0.95
getComponentTypesMethod · 0.95
getComponentTypesMethod · 0.95
getComponentTypesMethod · 0.95
extendMethod · 0.95
pairsMethod · 0.95

Calls

no outgoing calls

Tested by 2

forEachNameTypeMethod · 0.76
testQuotientListMethod · 0.76