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(Iterable<? extends T> a, Iterable<? extends T> b) 

Source Link

Document

Combines two iterables into a single iterable.

Usage

From source file:com.metamx.common.guava.FunctionalIterable.java

public FunctionalIterable<T> concat(Iterable<Iterable<T>> toConcat) {
    return new FunctionalIterable<>(Iterables.concat(delegate, Iterables.concat(toConcat)));
}

From source file:com.google.devtools.build.lib.util.FileTypeSet.java

/** Returns a copy of this {@link FileTypeSet} including the specified `fileTypes`. */
public FileTypeSet including(FileType... fileTypes) {
    return new FileTypeSet(Iterables.concat(this.types, Arrays.asList(fileTypes)));
}

From source file:org.obiba.mica.dataset.domain.HarmonizationDataset.java

@JsonIgnore
public List<BaseStudyTable> getBaseStudyTables() {
    return Lists.newArrayList(Iterables.concat(getStudyTables(), getHarmonizationTables())).stream()//
            .sorted(Comparator.comparingInt(OpalTable::getWeight)).collect(Collectors.toList());
}

From source file:org.jpmml.postgresql.PMMLUtil.java

static private void storeResult(Evaluator evaluator, Map<FieldName, ?> result, ResultSet response)
        throws SQLException {
    Map<String, Integer> columns = parseColumns(response);

    Iterable<FieldName> fields = Iterables.concat(evaluator.getTargetFields(), evaluator.getOutputFields());
    for (FieldName field : fields) {
        String label = normalize(field.getValue());

        Integer column = columns.get(label);
        if (column == null) {
            continue;
        }// w ww . jav  a  2  s  .  co m

        Object value = EvaluatorUtil.decode(result.get(field));
        if (value != null) {
            response.updateObject(column, value);
        } else

        {
            response.updateNull(column);
        }
    }
}

From source file:org.auraframework.impl.factory.StyleParser.java

@Override
public StyleDef getDefinition(DefDescriptor<StyleDef> descriptor, TextSource<StyleDef> source)
        throws QuickFixException {
    boolean shouldValidate = validate && !descriptor.getName().toLowerCase().endsWith("template")
            && Aura.getConfigAdapter().validateCss();

    String className = Styles.buildClassName(descriptor);

    ParserResult result = CssPreprocessor.initial().source(source.getContents())
            .resourceName(source.getSystemId())
            .allowedConditions(/*from  ww w. j a v a 2 s .com*/
                    Iterables.concat(ALLOWED_CONDITIONS, Aura.getStyleAdapter().getExtraAllowedConditions()))
            .componentClass(className, shouldValidate).tokens(descriptor).parse();

    StyleDefImpl.Builder builder = new StyleDefImpl.Builder();
    builder.setDescriptor(descriptor);
    builder.setLocation(source.getSystemId(), source.getLastModified());
    builder.setOwnHash(source.getHash());
    builder.setClassName(className);
    builder.setContent(result.content());
    builder.setTokenExpressions(result.expressions());
    builder.setAccess(new DefinitionAccessImpl(AuraContext.Access.PUBLIC));

    return builder.build();
}

From source file:msi.gaml.factories.DescriptionFactory.java

public final static Iterable<String> getProtoNames() {
    return Iterables.concat(getStatementProtoNames(), getVarProtoNames());
}

From source file:org.eclipse.sirius.ext.base.collect.GSetIntersection.java

/**
 * {@inheritDoc}/*  w  w  w . j a v a2  s .  c o m*/
 */
@Override
public Iterable<E> getRemovedElements() {
    return Iterables.concat(extraElementsToDelete, Sets.difference(oldElements.values(), newElements));
}

From source file:org.nickelproject.util.testUtil.TaggedSuite.java

private static Class<?>[] getTaggedClasses(final Class<?> klass) throws InitializationError {
    final List<String> vClassNames = Lists
            .newArrayList(Iterables.concat(ClasspathUtil.getAllConcreteSubClasses(getInterfaceTags(klass)),
                    ClasspathUtil.getAnnotatedClasses(getAnnotationTags(klass))));
    final Class<?>[] vSuiteClasses = getSuiteClasses(klass);
    final Class<?>[] vRetVal = new Class<?>[vClassNames.size() + vSuiteClasses.length];
    for (int i = 0; i < vClassNames.size(); i++) {
        try {/*from   ww  w .  ja va  2s  . co m*/
            vRetVal[i] = Class.forName(vClassNames.get(i));
        } catch (final ClassNotFoundException e) {
            throw new InitializationError(e);
        }
    }
    int j = 0;
    for (int i = vClassNames.size(); i < vRetVal.length; i++) {
        vRetVal[i] = vSuiteClasses[j++];
    }
    return vRetVal;
}

From source file:org.apache.beam.fn.harness.state.BagUserState.java

public Iterable<T> get() {
    checkState(!isClosed, "Bag user state is no longer usable because it is closed for %s", stateId);
    // If we were cleared we should disregard old values.
    if (oldValues == null) {
        return unmodifiableNewValues;
    }/*from  w  w w. j a v a  2  s . co  m*/
    return Iterables.concat(oldValues, unmodifiableNewValues);
}

From source file:chess_.engine.classic.board.Board.java

public Iterable<Piece> getAllPieces() {
    return Iterables.unmodifiableIterable(Iterables.concat(this.whitePieces, this.blackPieces));
}