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

Method partition

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

Divides an iterator into unmodifiable sublists of the given size (the final list may be smaller). For example, partitioning an iterator containing [a, b, c, d, e] with a partition size of 3 yields [[a, b, c], [d, e]] -- an outer iterator containing two inner lists of three and two el

(Iterator<T> iterator, int size)

Source from the content-addressed store, hash-verified

550 * @throws IllegalArgumentException if {@code size} is nonpositive
551 */
552 public static <T> UnmodifiableIterator<List<T>> partition(Iterator<T> iterator, int size) {
553 return partitionImpl(iterator, size, false);
554 }
555
556 /**
557 * Divides an iterator into unmodifiable sublists of the given size, padding

Callers 1

iteratorMethod · 0.95

Calls 1

partitionImplMethod · 0.95

Tested by

no test coverage detected