Example usage for com.google.common.collect ImmutableMultimap inverse

List of usage examples for com.google.common.collect ImmutableMultimap inverse

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableMultimap inverse.

Prototype

public abstract ImmutableMultimap<V, K> inverse();

Source Link

Document

Returns an immutable multimap which is the inverse of this one.

Usage

From source file:pt.ua.tm.neji.core.parser.ParserSupport.java

public static List<ParserLanguage> languagesSupportedByLevel(ParserTool tool, ParserLevel level) {
    ImmutableMultimap<ParserLanguage, ParserLevel> mapToUse = getMapforTool(tool);
    return Lists.newArrayList(mapToUse.inverse().get(level));
}

From source file:com.facebook.buck.android.dalvik.DalvikAwareZipSplitter.java

private DalvikAwareZipSplitter(ProjectFilesystem filesystem, Set<Path> inFiles, Path outPrimary,
        Path outSecondaryDir, String secondaryPattern, Path outDexStoresDir, long linearAllocLimit,
        Predicate<String> requiredInPrimaryZip, Set<String> wantedInPrimaryZip,
        ImmutableSet<String> secondaryHeadSet, ImmutableSet<String> secondaryTailSet,
        ImmutableMultimap<APKModule, String> additionalDexStoreSets, APKModule rootAPKModule,
        DexSplitStrategy dexSplitStrategy, Path reportDir) {
    if (linearAllocLimit <= 0) {
        throw new HumanReadableException("linear_alloc_hard_limit must be greater than zero.");
    }/*from   w  w  w. ja v  a2  s .  c om*/
    this.filesystem = filesystem;
    this.inFiles = ImmutableSet.copyOf(inFiles);
    this.outPrimary = outPrimary;
    this.secondaryDexWriter = new MySecondaryDexHelper("secondary", outSecondaryDir, secondaryPattern);
    this.additionalDexWriters = new HashMap<>();
    this.requiredInPrimaryZip = requiredInPrimaryZip;
    this.wantedInPrimaryZip = ImmutableSet.copyOf(wantedInPrimaryZip);
    this.secondaryHeadSet = secondaryHeadSet;
    this.secondaryTailSet = secondaryTailSet;
    this.classPathToDexStore = additionalDexStoreSets.inverse();
    for (APKModule dexStore : additionalDexStoreSets.keySet()) {
        if (!dexStore.equals(rootAPKModule)) {
            additionalDexWriters.put(dexStore, new MySecondaryDexHelper(dexStore.getCanaryClassName(),
                    outDexStoresDir.resolve(dexStore.getName()), secondaryPattern));
        }
    }
    this.rootModule = rootAPKModule;
    this.reportDir = reportDir;
    this.dexSplitStrategy = dexSplitStrategy;
    this.linearAllocLimit = linearAllocLimit;
    this.dalvikStatsCache = new DalvikStatsCache();
}