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

Method paddedPartition

output/java_guava/1.4.18/Iterators.java:604–606  ·  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

602
603
604 public static <T> UnmodifiableIterator<List<T>> paddedPartition(Iterator<T> iterator, int size) {
605 return partitionImpl(iterator, size, true);
606 }
607
608 private static <T> UnmodifiableIterator<List<T>> partitionImpl(final Iterator<T> iterator, final int size, final boolean pad) {
609 checkNotNull(iterator);

Callers 1

iteratorMethod · 0.95

Calls 1

partitionImplMethod · 0.95

Tested by

no test coverage detected