List of utility methods to do Collection Flatten
List | flatten(Collection flatten int size = 0; for (C col : colOfCols) { size += col.size(); ArrayList<T> list = new ArrayList<T>(size); for (C col : colOfCols) { list.addAll(col); return list; |
Collection | flatten(Class flatten try { Collection<T> flatCollection = cls.newInstance(); for (Collection<T> collection : collections) { flatCollection.addAll(collection); return flatCollection; } catch (RuntimeException re) { throw re; ... |
List | flatten(Collection extends Collection flatten List<E> result = new ArrayList<E>(); for (Collection<E> list : collections) { result.addAll(list); return result; |
Collection | flatten(Collection extends Collection flatten if (cols.size() == 0) { return Collections.emptyList(); } else if (cols.size() == 1) { return cols.iterator().next(); } else { Collection<V> result = new ArrayList<V>(); for (Collection<V> c : cols) { for (V v : c) { ... |
List> | flatten(Collection> l) flatten boolean hasCollection = false; for (Object o : l) { if (o instanceof Collection) { hasCollection = true; break; if (!hasCollection && (l instanceof List)) { ... |
List | flatten(Collection> list, Class flatten List<Object> retVal = new ArrayList<Object>(); flatten(list, retVal); return (List<T>) retVal; |
List | flatten(Collection
combines all the lists in a collection to a single list List<T> result = new ArrayList<T>(); for (List<T> list : nestedList) { result.addAll(list); return result; |
List | flatten(Collection
This method is NOT intended as a part of public API and should not be used outside the library! List<U> res = new ArrayList<U>(); for (List<U> l : collOfLists) { res.addAll(l); return res; |
String | flatten(Collection flatten StringBuilder buf = new StringBuilder(""); if (!isEmptyCollection(collection)) { Iterator<T> iter = collection.iterator(); buf.append(String.valueOf(iter.next())); while (iter.hasNext()) { buf.append(separator).append(String.valueOf(iter.next())); return buf.toString(); |
Collection | flatten(Collection flatten boolean hasNested = false; for (Object o : original) { if (o instanceof Collection) { hasNested = true; break; if (!hasNested) ... |