Example usage for com.google.common.collect Multiset stream

List of usage examples for com.google.common.collect Multiset stream

Introduction

In this page you can find the example usage for com.google.common.collect Multiset stream.

Prototype

default Stream<E> stream() 

Source Link

Document

Returns a sequential Stream with this collection as its source.

Usage

From source file:de.blizzy.rust.lootconfig.LootConfigDump.java

private float sum(Multiset<Float> chances) {
    return (float) (double) chances.stream().collect(Collectors.summingDouble(f -> f));
}

From source file:io.fd.maintainer.plugin.util.MaintainersIndex.java

private MatchLevel maxMatchLevel(final Multiset<MatchLevel> keys) {
    return keys.stream().max(MAX).orElse(NONE);
}

From source file:com.opengamma.strata.report.framework.expression.IterableTokenEvaluator.java

@Override
public Set<String> tokens(Iterable<?> iterable) {
    Multiset<String> tokens = HashMultiset.create();
    int index = 0;

    for (Object item : iterable) {
        tokens.add(String.valueOf(index++));
        tokens.addAll(fieldValues(item));
    }/*  www .j  av a  2  s . c  om*/
    return tokens.stream().filter(token -> tokens.count(token) == 1).collect(toImmutableSet());
}