The list of methods to do Collection Split are organized into topic(s).
Collection
getStringCollection(String str, String split)
Returns a collection of strings.
if (split == null || split.isEmpty()) {
split = ",";
List<String> values = new ArrayList<String>();
if (str == null)
return values;
StringTokenizer tokenizer = new StringTokenizer(str, split);
values = new ArrayList<String>();
...
Collection extends T>
split(Collection extends T> d, int n) split
Collection<T> tmp = new ArrayList<>();
Iterator it = d.iterator();
int k = Math.max(0, n);
while (it.hasNext() && k > 0) {
tmp.add((T) it.next());
k--;
return tmp;
...
String
split(Collection> collections, String separator) split
Object[] array = collections.toArray(new Object[0]);
int length = array.length;
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < length; i++) {
stringBuilder.append(array[i]);
if (i != length - 1) {
stringBuilder.append(separator);
return stringBuilder.toString();
List
> split(Collection orig, int batchSize)
split
if (orig == null || orig.isEmpty() || batchSize < 1) {
return Collections.emptyList();
int size = orig.size();
int len = calSplitLen(batchSize, size);
List<List<T>> result = new ArrayList<>(len);
List<T> list = null;
if (orig instanceof List) {
...
List
[] split(Collection set, int n)
Splits a collection in n new collections.
if (set.size() >= n) {
@SuppressWarnings("unchecked")
List<T>[] arrays = new List[n];
int minSegmentSize = (int) Math.floor(set.size() / (double) n);
int start = 0;
int stop = minSegmentSize;
Iterator<T> it = set.iterator();
for (int i = 0; i < n - 1; i++) {
...