Example usage for com.google.common.collect ImmutableSortedSet naturalOrder

List of usage examples for com.google.common.collect ImmutableSortedSet naturalOrder

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableSortedSet naturalOrder.

Prototype

public static <E extends Comparable<?>> Builder<E> naturalOrder() 

Source Link

Usage

From source file:edu.mit.streamjit.impl.compiler2.Compiler2.java

/**
 * Creates the blob host.  This mostly involves shuffling our state into the
 * form the blob host wants.//from w  ww . j av  a 2  s  .  c o  m
 * @return the blob
 */
public Blob instantiateBlob() {
    ImmutableSortedSet.Builder<Token> inputTokens = ImmutableSortedSet.naturalOrder(),
            outputTokens = ImmutableSortedSet.naturalOrder();
    for (TokenActor ta : Iterables.filter(actors, TokenActor.class))
        (ta.isInput() ? inputTokens : outputTokens).add(ta.token());
    ImmutableList.Builder<MethodHandle> storageAdjusts = ImmutableList.builder();
    for (ConcreteStorage s : steadyStateStorage.values())
        storageAdjusts.add(s.adjustHandle());
    return new Compiler2BlobHost(workers, config, inputTokens.build(), outputTokens.build(), initCode,
            steadyStateCode, storageAdjusts.build(), initReadInstructions, initWriteInstructions,
            migrationInstructions, readInstructions, writeInstructions, drainInstructions, precreatedBuffers);
}

From source file:org.apache.beam.sdk.options.PipelineOptionsFactory.java

@VisibleForTesting
static Set<String> getSupportedRunners() {
    ImmutableSortedSet.Builder<String> supportedRunners = ImmutableSortedSet.naturalOrder();
    for (Class<? extends PipelineRunner<?>> runner : SUPPORTED_PIPELINE_RUNNERS.values()) {
        supportedRunners.add(runner.getSimpleName());
    }//from  w  w w  .  j  av a  2  s.c  om
    return supportedRunners.build();
}