All Downloads are FREE. Search and download functionalities are using the official Maven repository.

htsjdk.samtools.util.Iterables Maven / Gradle / Ivy

There is a newer version: 4.1.3
Show newest version
package htsjdk.samtools.util;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @author mccowan
 */
public class Iterables {
    private Iterables() {
        
    }

    public static  List slurp(final Iterator iterator) {
        final List ts = new ArrayList();
        while (iterator.hasNext()) ts.add(iterator.next());
        return ts;
    }

    public static  List slurp(final Iterable iterable) {
        return slurp(iterable.iterator());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy