Java Collection Flatten flattenForest(Collection forest)

Here you can find the source of flattenForest(Collection forest)

Description

flatten Forest

License

Open Source License

Declaration

public static Collection flattenForest(Collection forest) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Collection;
import java.util.Iterator;

import java.util.LinkedHashSet;

public class Main {
    public static Collection flattenForest(Collection forest) {
        final Collection ret = new LinkedHashSet();
        for (final Iterator it = forest.iterator(); it.hasNext();) {
            final Collection set = (Collection) it.next();
            ret.addAll(set);// w w  w  . j  a v  a2s .c  om
        }
        return ret;
    }
}

Related

  1. flatten(Collection collection, char separator)
  2. flatten(Collection original)
  3. flatten(final S targetCollection, final Collection> setOfSets)
  4. flattenCollection(Collection col)
  5. flattenCollection(Collection array, String fmt, char separator)
  6. flattenNodeIds( Collection> nodesInMotif)
  7. flattenStrings(Collection values)
  8. flattenToString(Collection c)
  9. flattenToString(Collection collection, String delimiter)