List of utility methods to do Collection Merge
String | getMergedString(Collection values, String delimiter) Get the merged string of the set delimited by a string Iterator<Integer> iterator = values.iterator(); StringBuffer stringBuffer = new StringBuffer(); while (iterator.hasNext()) { Object value = iterator.next(); stringBuffer.append(value); if (iterator.hasNext()) { stringBuffer.append(delimiter); return stringBuffer.toString(); |
CC | merge(CC target, Collection extends A> a, Collection extends A> b) Merge collections a and b into target .
target.addAll(a);
target.addAll(b);
return target;
|
Collection | merge(Collection dest, Collection src) Method merge if (src == null) { return dest; if (dest == null) { return src; dest.addAll(src); return dest; ... |
List | merge(Collection merge if (splits == null || splits.isEmpty()) { return Collections.emptyList(); List<T> list = new ArrayList<>(); for (Collection<T> split : splits) { list.addAll(split); return list; ... |
String | merge(Collection merge if (strings.isEmpty()) { return ""; StringBuilder sb = new StringBuilder(); for (String s : strings) { sb.append(s); sb.append(separator); sb.setLength(sb.length() - 1); return sb.toString(); |
List | merge(Collection merge int size = 0; for (Collection collection : collections) { size += collection.size(); ArrayList<T> ret = new ArrayList<T>(size); for (Collection collection : collections) { ret.addAll(collection); return ret; |
List | merge(Collection Merges multiple collections into a list with natural ordering of elements Set<T> merged = new TreeSet<T>(); for (Collection<T> list : collections) { for (T element : list) { merged.add(element); return new ArrayList(merged); |
List | merge(Collection Merge few collections in one. List<T> resultList = arrayList(); if (elems != null) { for (Collection<T> eachCollection : elems) { resultList.addAll(eachCollection); return resultList; |
String | merge(final Collection merge final StringBuilder merged = new StringBuilder(); boolean first = true; for (String value : values) { if (!first) { merged.append(","); } else { first = false; merged.append(value); return merged.toString(); |
boolean | merge(J just, Collection Merges a given justification into a given collection of justifications. int justSize = just.size(); final Iterator<J> oldJustIter = justs.iterator(); boolean isASubsetOfOld = false; while (oldJustIter.hasNext()) { final J oldJust = oldJustIter.next(); if (justSize < oldJust.size()) { if (oldJust.containsAll(just)) { oldJustIter.remove(); ... |