T - 字段类型public class PartitionIter<T> extends Object implements IterableIter<List<T>>, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected Iterator<T> |
iterator
被分批的迭代器
|
protected int |
partitionSize
实际每批大小
|
| Constructor and Description |
|---|
PartitionIter(Iterator<T> iterator,
int partitionSize)
创建分组对象
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
List<T> |
next() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waititeratorforEach, spliteratorforEachRemaining, removepublic PartitionIter(Iterator<T> iterator, int partitionSize)
iterator - 迭代器partitionSize - 每批大小,最后一批不满一批算一批IllegalArgumentException - 当partitionSize小于等于0,或iterator为null时抛出Copyright © 2025. All rights reserved.