List of utility methods to do Collection Split
void | fastSplit(final Collection fast Split if (text == null) return; if (text.length() == 0) return; int index1 = 0; int index2 = text.indexOf(separator); if (index2 >= 0) { String token = null; ... |
String | getCollectionStringBySplit(Collection collection, String split) get Collection String By Split return getArrayStringBySplit(collection.toArray(), split);
|
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>(); ... |
String | getSymbolSplitString(Collection> collection, String symbol) Return a string split by the symbol. return getSymbolSplitString(collection.toArray(), symbol);
|
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 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 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++) { ... |
Collection | split(final Collection Splits a collection into several collections. return split(collection, 500);
|
void | splitAndKeepEscapedSpaces(String string, boolean preserveEscapes, Collection split And Keep Escaped Spaces StringBuilder current = new StringBuilder(); for (int i = 0; i < string.length(); i++) { char ch = string.charAt(i); if (ch == ' ') { boolean isGluedSpace = i > 0 && string.charAt(i - 1) == '\\'; if (!isGluedSpace) { into.add(current.toString()); current = new StringBuilder(); ... |