MCPcopy Create free account
hub / github.com/antlr/codebuff / paddedPartition

Method paddedPartition

corpus/java/training/guava/collect/Iterators.java:572–574  ·  view source on GitHub ↗

Divides an iterator into unmodifiable sublists of the given size, padding the final iterator with null values if necessary. For example, partitioning an iterator containing [a, b, c, d, e] with a partition size of 3 yields [[a, b, c], [d, e, null]] -- an outer iterator containing two

(Iterator<T> iterator, int size)

Source from the content-addressed store, hash-verified

570 * @throws IllegalArgumentException if {@code size} is nonpositive
571 */
572 public static <T> UnmodifiableIterator<List<T>> paddedPartition(Iterator<T> iterator, int size) {
573 return partitionImpl(iterator, size, true);
574 }
575
576 private static <T> UnmodifiableIterator<List<T>> partitionImpl(
577 final Iterator<T> iterator, final int size, final boolean pad) {

Callers 1

iteratorMethod · 0.95

Calls 1

partitionImplMethod · 0.95

Tested by

no test coverage detected