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)
| 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>] |
no outgoing calls