Example usage for com.google.common.collect Iterables concat

List of usage examples for com.google.common.collect Iterables concat

Introduction

In this page you can find the example usage for com.google.common.collect Iterables concat.

Prototype

public static <T> Iterable<T> concat(final Iterable<? extends Iterable<? extends T>> inputs) 

Source Link

Document

Combines multiple iterables into a single iterable.

Usage

From source file:sg.atom.utils._beta.functional.FunctionalIterable.java

public static <T> FunctionalIterable<T> fromConcatenation(Iterable<Iterable<T>> delegates) {
    return new FunctionalIterable<T>(Iterables.concat(delegates));
}

From source file:org.opennms.newts.gsod.FileIterable.java

public static FluentIterable<Path> fileTreeWalker(final Path root) {
    return FluentIterable.from(Iterables.concat(groupFilesByDir(root)));
}

From source file:org.jclouds.cloudwatch.CloudWatch.java

/**
 * List metrics based on the criteria in the {@link ListMetricsOptions} passed in.
 *
 * @param metricApi the {@link MetricApi} to use for the request
 * @param options the {@link ListMetricsOptions} describing the ListMetrics request
 *
 * @return iterable of metrics fitting the criteria
 *///  w  ww.ja  v a2 s  .  co  m
public static Iterable<Metric> listMetrics(final MetricApi metricApi, final ListMetricsOptions options) {
    return Iterables.concat(
            PagedIterables.advance(metricApi.list(options), new Function<Object, IterableWithMarker<Metric>>() {

                @Override
                public IterableWithMarker<Metric> apply(Object input) {
                    return metricApi.list(options.clone().afterMarker(input));
                }

                @Override
                public String toString() {
                    return "listMetrics(" + options + ")";
                }
            }));
}

From source file:com.facebook.presto.util.NestedIterableTransformer.java

public IterableTransformer<E> flatten() {
    return new IterableTransformer<>(Iterables.concat(iterable));
}

From source file:org.jon.ivmark.graphit.core.graph.traversal.Combiner.java

@Override
public Iterable<T> map(Iterable<Iterable<T>> input) {
    return Iterables.concat(input);
}

From source file:c5db.module_cfg.ModuleDeps.java

public static List<ModuleType> getModuleReverseDependencyOrder(Collection<Class<?>> startThese)
        throws ClassNotFoundException {
    List<ModuleType> moduleTypeList = new ArrayList<>(startThese.size());

    for (Graph.Node<ModuleType> node : Iterables.concat(createGraph(startThese))) {
        moduleTypeList.add(node.type);/* www  .  j  ava  2s . co m*/
    }

    return moduleTypeList;
}

From source file:com.facebook.buck.rules.coercer.SortedSetConcatable.java

@Override
public ImmutableSortedSet<T> concat(Iterable<ImmutableSortedSet<T>> elements) {
    return ImmutableSortedSet.copyOf(Iterables.concat(elements));
}

From source file:org.netbeans.modules.android.grammars.UIClassDescriptors.java

static Iterable<UIClassDescriptor> findBySimpleName(WidgetData classData, String simpleClassName) {
    return findByName(Iterables.concat(classData.data.values()), simpleName(simpleClassName));
}

From source file:org.pentaho.di.trans.dataservice.optimization.paramgen.SourceLineageMap.java

public static SourceLineageMap create(Map<String, Set<List<StepFieldOperations>>> operationPaths) {
    SourceLineageMap sourceLineageMap = create();
    for (List<StepFieldOperations> lineage : Iterables.concat(operationPaths.values())) {
        if ((lineage != null) && !lineage.isEmpty()) {
            String inputStep = lineage.get(0).getStepName();
            sourceLineageMap.put(inputStep, lineage);
        }/*from  www  .ja v a2  s. co m*/
    }
    return sourceLineageMap;
}

From source file:com.google.api.services.samples.storage.examples.ObjectsListExample.java

public static Iterable<StorageObject> list(Storage storage, String bucketName) throws IOException {
    List<List<StorageObject>> pagedList = Lists.newArrayList();
    Storage.Objects.List listObjects = storage.objects().list(bucketName);
    Objects objects;/*from  w  ww  .  j  a va  2 s.c o m*/
    do {
        objects = listObjects.execute();
        List<StorageObject> items = objects.getItems();
        if (items != null) {
            pagedList.add(objects.getItems());
        }
        listObjects.setPageToken(objects.getNextPageToken());
    } while (objects.getNextPageToken() != null);
    return Iterables.concat(pagedList);
}