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:com.facebook.buck.android.relinker.RelinkerRule.java

private static BuildRuleParams withDepsFromArgs(BuildRuleParams params, SourcePathRuleFinder ruleFinder,
        ImmutableList<Arg> args) {
    return params.appendExtraDeps(Iterables.concat(Iterables.transform(args, arg -> arg.getDeps(ruleFinder))));
}

From source file:org.karsha.base.EnglishLemmaTokenizer.java

/**
 * Construct a tokenizer processing the given input using the given tagger.
 *///from   www  .  ja  v  a 2 s .  c  o  m

public EnglishLemmaTokenizer(Reader input, MaxentTagger tagger) {
    super();

    lemmaNext = false;
    posIncr = addAttribute(PositionIncrementAttribute.class);
    termAtt = addAttribute(TermAttribute.class);
    List<List<HasWord>> tokenized = MaxentTagger.tokenizeText(input);
    //List<ArrayList<? extends HasWord>> tokenized =MaxentTagger.tokenizeText(input);

    tagged = Iterables.concat(tagger.process(tokenized)).iterator();
}

From source file:org.apache.giraph.block_app.framework.block.BlockTestingUtils.java

/**
 * Test how the block interacts with a repeatBlock. The expected result is to
 * see the pieces in referenceImpl show up REPEAT_TIMES many times.
 * @param referenceImpl : A list of pieces in the expected order
 * @param block : The block to test//w  w  w.  j a va2s  .  c om
 */
public static void testNestedRepeatBlock(Iterable<? extends AbstractPiece> referenceImpl, Block block) {
    Block repeatBlock = new RepeatBlock(REPEAT_TIMES, block);
    testIndependence(Iterables.concat(Collections.nCopies(REPEAT_TIMES, referenceImpl)), repeatBlock);
}

From source file:kr.co.vcnc.haeinsa.HaeinsaDelete.java

/**
 * Merge all familyMap to this instance.
 *
 * @throw IllegalStateException if newMuatation is not HaeinsaDelete
 *///from  w w  w.  j  a va 2 s .  c o m
@Override
public void add(HaeinsaMutation newMutation) {
    Preconditions.checkState(newMutation instanceof HaeinsaDelete);
    for (HaeinsaKeyValue newKV : Iterables.concat(newMutation.getFamilyMap().values())) {
        if (newKV.getType() == KeyValue.Type.DeleteFamily) {
            deleteFamily(newKV.getFamily());
        } else {
            deleteColumns(newKV.getFamily(), newKV.getQualifier());
        }
    }
}

From source file:org.apache.cassandra.cql3.restrictions.RestrictionSet.java

@Override
public Iterable<Function> getFunctions() {
    com.google.common.base.Function<Restriction, Iterable<Function>> transform = new com.google.common.base.Function<Restriction, Iterable<Function>>() {
        public Iterable<Function> apply(Restriction restriction) {
            return restriction.getFunctions();
        }/* www . j a  v a2  s  . c o m*/
    };

    return Iterables.concat(Iterables.transform(restrictions.values(), transform));
}

From source file:org.eclipse.sirius.synchronizer.RefreshPlanner.java

/**
 * Computes the RefreshPlan from a CreatedOutput.
 * /*from   www  . j av  a2 s  . c  o m*/
 * @param container
 *            the CreatedOutput to computes the RefreshPlan from
 * @return the RefreshPlan computed from the given CreatedOutput
 */
public RefreshPlan computePlan(CreatedOutput container) {
    RefreshPlan post = new RefreshPlan(signatureProvider);

    Collection<? extends Mapping> childMappings = container.getChildMappings();

    pre.computeStatus(container, childMappings);
    post.addPreviousStatus(pre.getExistingOutputs());

    Iterable<? extends Mapping> mappingsCreatingElements = Iterables.filter(childMappings,
            new Predicate<Mapping>() {
                @Override
                public boolean apply(Mapping input) {
                    return input.getCreator().some();
                }
            });
    Iterable<Collection<MappingHiearchy>> transformedHiearchy = Iterables.transform(mappingsCreatingElements,
            toHierarchy);
    Iterable<MappingHiearchy> childHiearchies = Sets.newLinkedHashSet(Iterables.concat(transformedHiearchy));

    for (MappingHiearchy nodeHiearch : childHiearchies) {
        Iterator<Mapping> it = nodeHiearch.fromMostSpecificToMostGeneral();
        while (it.hasNext()) {
            Mapping cur = it.next();
            if (cur.isEnabled() && cur.getCreator().some()) {
                Option<EvaluatedSemanticPartition> par = invalidator.hasFastResult(
                        container.getDescriptor().getSourceElement(), cur.getSemanticPartition(), container);
                if (!par.some()) {
                    par = Options.newSome(cur.getSemanticPartition()
                            .evaluate(container.getDescriptor().getSourceElement(), container));
                }
                Collection<? extends OutputDescriptor> allCandidateDescriptors = cur.getCreator().get()
                        .computeDescriptors(container, par.get().elements());
                post.appendOutputDescritorsKeepingTheMostSpecific(allCandidateDescriptors);
            }
        }
    }
    return post;
}

From source file:ratpack.util.internal.ImmutableDelegatingMultiValueMap.java

@SuppressWarnings("NullableProblems")
public Collection<V> values() {
    return Lists.newArrayList(Iterables.concat(delegate.values()));
}