Package org.miaixz.bus.core.center.list
Class RandomAccessAvgPartition<T>
java.lang.Object
java.util.AbstractCollection<List<T>>
java.util.AbstractList<List<T>>
org.miaixz.bus.core.center.list.Partition<T>
org.miaixz.bus.core.center.list.AvgPartition<T>
org.miaixz.bus.core.center.list.RandomAccessAvgPartition<T>
- Type Parameters:
T- 元素类型
- All Implemented Interfaces:
Iterable<List<T>>,Collection<List<T>>,List<List<T>>,RandomAccess,SequencedCollection<List<T>>
列表分区或分段(可随机访问列表) 通过传入分区个数,将指定列表分区为不同的块,每块区域的长度均匀分布(个数差不超过1)
[1,2,3,4] - [1,2], [3, 4]
[1,2,3,4] - [1,2], [3], [4]
[1,2,3,4] - [1], [2], [3], [4]
[1,2,3,4] - [1], [2], [3], [4], []
分区是在原List的基础上进行的,返回的分区是不可变的抽象列表,原列表元素变更,分区中元素也会变更。- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.miaixz.bus.core.center.list.AvgPartition
get, sizeMethods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addAll, addFirst, addLast, contains, containsAll, getFirst, getLast, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, toArray, toArray
-
Constructor Details
-
RandomAccessAvgPartition
列表分区- Parameters:
list- 被分区的列表limit- 分区个数
-