List of utility methods to do Collection Combine
List | combine(Collection extends T> first, Collection extends T> second) combine List<T> result = new ArrayList<T>(first.size() + second.size()); result.addAll(first); result.addAll(second); return result; |
List | combine(Collection>... collections) combine all lists into one list containing all elements. List<T> list = new ArrayList<T>(); if (collections != null && collections.length > 0) { for (Collection<?> c : collections) { for (Object t : c) { list.add((T) t); return list; |
String | combine(Collection combine Iterator<String> iter = strings.iterator(); if (!iter.hasNext()) { return ""; String rtrn = iter.next(); while (iter.hasNext()) { rtrn += "_" + iter.next(); return rtrn; |
Collection
| combine(final Collection Functions that makes every possible combination of items from an array of collection while respecting the order of the collections. Collection<List<V>> result = new Vector(); Vector<V> combination = new Vector(c.length); Iterator<V>[] state = new Iterator[c.length]; for (int i = 0; i < c.length; i++) { state[i] = c[i].iterator(); if (state[i].hasNext()) combination.add(state[i].next()); else ... |
String | combine(String separator, Collection combine return join(separator, parts);
|
String | combine(String separator, Collection Combines a collection of strings into a single string, separated by the given character set return combineArray(separator, stringCollection.toArray(EMPTY_STRING_ARRAY));
|
String | combine(String separator, Collection Combine the objects in Collection with the specified separator. StringBuffer sb = new StringBuffer(); if (objs != null && objs.size() > 0) { Iterator<T> it = objs.iterator(); for (;;) { sb.append(it.next().toString()); if (it.hasNext()) sb.append(separator); else ... |
Collection | combineAndRemoveDuplicates(Collection combine And Remove Duplicates Collection<T> merged; try { merged = collection1.getClass().newInstance(); } catch (Exception ex) { merged = new ArrayList<T>(); merged.addAll(collection1); merged.addAll(collection2); ... |
Collection | combineCollections(Collection combine Collections Collection<T> result = null; if (sessionCollection != null && !sessionCollection.isEmpty()) { result = new ArrayList<T>(); result.addAll(sessionCollection); if (reqCollection != null && !reqCollection.isEmpty()) { if (result == null) { result = new ArrayList<T>(); ... |
List | CombineCollections(final Collection... collections) Used when you have two or more lists of units, etc and you want all the units in one collection. final List result = new ArrayList(); for (final Collection collection : collections) { result.addAll(collection); return result; |