當前位置: 首頁>>代碼示例>>Java>>正文


Java SortedSetMultimap.keySet方法代碼示例

本文整理匯總了Java中com.google.common.collect.SortedSetMultimap.keySet方法的典型用法代碼示例。如果您正苦於以下問題:Java SortedSetMultimap.keySet方法的具體用法?Java SortedSetMultimap.keySet怎麽用?Java SortedSetMultimap.keySet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.common.collect.SortedSetMultimap的用法示例。


在下文中一共展示了SortedSetMultimap.keySet方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

import com.google.common.collect.SortedSetMultimap; //導入方法依賴的package包/類
public static void main(String[] args) throws IOException {
    if(args.length == 0) {
        System.err.println("Usage: ProcessActionsXml <IntelliJDir1> [<IntelliJDir2] ...");
        return;
    }

    try (final Writer out = new BufferedWriter(new FileWriter("docs/_data/actions.csv"))) {
        try (final CSVPrinter printer = CSVFormat.DEFAULT.withHeader("file", "id", "text", "group", "link").print(out)) {
            for (String dir : args) {
                ActionDirectoryWalker walker = new ActionDirectoryWalker();
                final SortedSetMultimap<String, ActionIDDef> ids = walker.walk(new File(dir));
                for (String file : ids.keySet()) {
                    for (ActionIDDef def : ids.get(file)) {
                        final String fileName = StringUtils.removeStart(StringUtils.removeStart(StringUtils.removeStart(file, dir), "\\"), "/");
                        System.out.println("File: " + fileName + ": had " + def.getId() + "/" + def.getText() + "/" + def.getGroup() + "/" + def.getLink());
                        printer.print(fileName);
                        printer.print(def.getId());
                        printer.print(def.getText());
                        printer.print(def.getGroup());
                        printer.print(def.getLink());
                        printer.println();
                    }
                }

                System.out.println("Found " + ids.size() + " actions in " + ids.keySet().size() + " files");
            }
        }
    }
}
 
開發者ID:centic9,項目名稱:IntelliJ-Action-IDs,代碼行數:30,代碼來源:ProcessActionsXml.java

示例2: loadedRegionsAreSortedCorrectly

import com.google.common.collect.SortedSetMultimap; //導入方法依賴的package包/類
@Test
public void loadedRegionsAreSortedCorrectly() throws IOException, EmptyFileException {
    final SortedSetMultimap<String, HmfGenomeRegion> geneRegions = HmfGenePanelSupplier.allGeneMap();
    for (final String chromosome : geneRegions.keySet()) {
        long start = 0;
        for (final HmfGenomeRegion hmfGenomeRegion : geneRegions.get(chromosome)) {
            assertTrue(hmfGenomeRegion.start() >= start);
            start = hmfGenomeRegion.start();
        }
    }
}
 
開發者ID:hartwigmedical,項目名稱:hmftools,代碼行數:12,代碼來源:HmfGenePanelSupplierTest.java

示例3: writePerPackageRDotJava

import com.google.common.collect.SortedSetMultimap; //導入方法依賴的package包/類
@VisibleForTesting
void writePerPackageRDotJava(
    SortedSetMultimap<String, RDotTxtEntry> packageToResources,
    ProjectFilesystem filesystem) throws IOException {
  for (String rDotJavaPackage : packageToResources.keySet()) {
    Path outputFile = getPathToRDotJava(rDotJavaPackage);
    filesystem.mkdirs(outputFile.getParent());
    try (PrintWriter writer = new PrintWriter(filesystem.newFileOutputStream(outputFile))) {
      writer.format("package %s;\n\n", rDotJavaPackage);
      writer.println("public class R {\n");

      RDotTxtEntry.RType lastType = null;

      for (RDotTxtEntry res : packageToResources.get(rDotJavaPackage)) {
        RDotTxtEntry.RType type = res.type;
        if (!type.equals(lastType)) {
          // If the previous type needs to be closed, close it.
          if (lastType != null) {
            writer.println("  }\n");
          }

          // Now start the block for the new type.
          writer.format("  public static class %s {\n", type);
          lastType = type;
        }

        // Write out the resource.
        // Write as an int.
        writer.format(
            "    public static%s%s %s=%s;\n",
            uberRDotTxt.isPresent() ? " final " : " ",
            res.idType,
            res.name,
            res.idValue);
      }

      // If some type was written (e.g., the for loop was entered), then the last type needs to be
      // closed.
      if (lastType != null) {
        writer.println("  }\n");
      }

      // Close the class definition.
      writer.println("}");
    }
  }
}
 
開發者ID:saleehk,項目名稱:buck-cutom,代碼行數:48,代碼來源:MergeAndroidResourcesStep.java

示例4: writePerPackageRDotJava

import com.google.common.collect.SortedSetMultimap; //導入方法依賴的package包/類
@VisibleForTesting
void writePerPackageRDotJava(
    SortedSetMultimap<String, RDotTxtEntry> packageToResources, ProjectFilesystem filesystem)
    throws IOException {
  for (String rDotJavaPackage : packageToResources.keySet()) {
    Path outputFile = getPathToRDotJava(rDotJavaPackage);
    filesystem.mkdirs(outputFile.getParent());
    try (ThrowingPrintWriter writer =
        new ThrowingPrintWriter(filesystem.newFileOutputStream(outputFile))) {
      writer.format("package %s;\n\n", rDotJavaPackage);
      writer.format("public class %s {\n", rName);

      ImmutableList.Builder<String> customDrawablesBuilder = ImmutableList.builder();
      ImmutableList.Builder<String> grayscaleImagesBuilder = ImmutableList.builder();
      RType lastType = null;

      for (RDotTxtEntry res : packageToResources.get(rDotJavaPackage)) {
        RType type = res.type;
        if (!type.equals(lastType)) {
          // If the previous type needs to be closed, close it.
          if (lastType != null) {
            writer.println("  }\n");
          }

          // Now start the block for the new type.
          writer.format("  public static class %s {\n", type);
          lastType = type;
        }

        // Write out the resource.
        // Write as an int.
        writer.format(
            "    public static%s%s %s=%s;\n",
            forceFinalResourceIds ? " final " : " ", res.idType, res.name, res.idValue);

        if (type == RType.DRAWABLE && res.customType == RDotTxtEntry.CustomDrawableType.CUSTOM) {
          customDrawablesBuilder.add(res.idValue);
        } else if (type == RType.DRAWABLE
            && res.customType == RDotTxtEntry.CustomDrawableType.GRAYSCALE_IMAGE) {
          grayscaleImagesBuilder.add(res.idValue);
        }
      }

      // If some type was written (e.g., the for loop was entered), then the last type needs to be
      // closed.
      if (lastType != null) {
        writer.println("  }\n");
      }

      ImmutableList<String> customDrawables = customDrawablesBuilder.build();
      if (customDrawables.size() > 0) {
        // Add a new field for the custom drawables.
        writer.format("  public static final int[] custom_drawables = ");
        writer.format("{ %s };\n", Joiner.on(",").join(customDrawables));
        writer.format("\n");
      }

      ImmutableList<String> grayscaleImages = grayscaleImagesBuilder.build();
      if (grayscaleImages.size() > 0) {
        // Add a new field for the custom drawables.
        writer.format("  public static final int[] grayscale_images = ");
        writer.format("{ %s };\n", Joiner.on(",").join(grayscaleImages));
        writer.format("\n");
      }

      // Close the class definition.
      writer.println("}");
    }
  }
}
 
開發者ID:facebook,項目名稱:buck,代碼行數:71,代碼來源:MergeAndroidResourcesStep.java


注:本文中的com.google.common.collect.SortedSetMultimap.keySet方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。