Example usage for com.google.common.collect Iterators forArray

List of usage examples for com.google.common.collect Iterators forArray

Introduction

In this page you can find the example usage for com.google.common.collect Iterators forArray.

Prototype

public static <T> UnmodifiableIterator<T> forArray(final T... array) 

Source Link

Document

Returns an iterator containing the elements of array in order.

Usage

From source file:org.datacleaner.reference.SimpleDictionary.java

private static Set<String> createValueSet(Object[] array, boolean caseSensitive) {
    return createValueSet(Iterators.forArray(array), caseSensitive);
}

From source file:org.sonar.css.tree.impl.scss.ScssConditionTreeImpl.java

@Override
public Iterator<Tree> childrenIterator() {
    return Iterators.forArray(condition);
}

From source file:com.webbfontaine.valuewebb.irms.impl.bean.Calculator.java

private static boolean anyNullOrZero(BigDecimal... values) {
    Predicate<BigDecimal> composite = Predicates.or(new EqualsNullPredicate(), new EqualsZeroPredicate());
    return Iterators.any(Iterators.forArray(values), composite);
}

From source file:com.google.devtools.build.skyframe.DepsReport.java

@Override
public Iterator<SkyKey> iterator() {
    return Iterators.limit(Iterators.forArray(arr), size);
}

From source file:net.minecrell.serverlistplus.core.replacement.util.Literals.java

public static String replace(String s, String literal, Object... replacements) {
    return Helper.isNullOrEmpty(replacements) ? s : replace(s, literal, Iterators.forArray(replacements));
}

From source file:org.elasticsearch.action.admin.indices.stats.IndexShardStats.java

@Override
public Iterator<ShardStats> iterator() {
    return Iterators.forArray(shards);
}

From source file:co.cask.cdap.internal.app.runtime.messaging.AbstractMessagePublisher.java

@Override
public final void publish(String namespace, String topic, Charset charset, String... payloads)
        throws IOException, TopicNotFoundException {
    publish(namespace, topic, charset, Iterators.forArray(payloads));
}

From source file:org.elasticsearch.index.analysis.DutchStemTokenFilterFactory.java

@Inject
public DutchStemTokenFilterFactory(Index index, @IndexSettings Settings indexSettings, @Assisted String name,
        @Assisted Settings settings) {/* ww  w  .  j  av  a  2  s  . co m*/
    super(index, indexSettings, name, settings);
    String[] stemExclusion = settings.getAsArray("stem_exclusion");
    if (stemExclusion.length > 0) {
        this.exclusions = ImmutableSet.copyOf(Iterators.forArray(stemExclusion));
    } else {
        this.exclusions = ImmutableSet.of();
    }
}

From source file:org.elasticsearch.index.analysis.GermanStemTokenFilterFactory.java

@Inject
public GermanStemTokenFilterFactory(Index index, @IndexSettings Settings indexSettings, @Assisted String name,
        @Assisted Settings settings) {//from  w  w w .  ja  va 2  s.  c om
    super(index, indexSettings, name, settings);
    String[] stemExclusion = settings.getAsArray("stem_exclusion");
    if (stemExclusion.length > 0) {
        this.exclusions = ImmutableSet.copyOf(Iterators.forArray(stemExclusion));
    } else {
        this.exclusions = ImmutableSet.of();
    }
}

From source file:org.elasticsearch.index.analysis.CjkAnalyzerProvider.java

@Inject
public CjkAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name,
        @Assisted Settings settings) {/*from   w w  w  .  jav a  2 s  .  c om*/
    super(index, indexSettings, name);
    String[] stopWords = settings.getAsArray("stopwords");
    if (stopWords.length > 0) {
        this.stopWords = ImmutableSet.copyOf(Iterators.forArray(stopWords));
    } else {
        this.stopWords = CJKAnalyzer.getDefaultStopSet();
    }

    analyzer = new CJKAnalyzer(Version.LUCENE_CURRENT, this.stopWords);
}