当前位置: 首页>>代码示例>>Java>>正文


Java MultiMap.keySet方法代码示例

本文整理汇总了Java中com.intellij.util.containers.MultiMap.keySet方法的典型用法代码示例。如果您正苦于以下问题:Java MultiMap.keySet方法的具体用法?Java MultiMap.keySet怎么用?Java MultiMap.keySet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.util.containers.MultiMap的用法示例。


在下文中一共展示了MultiMap.keySet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: analyzeDfaWithNestedClosures

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
private void analyzeDfaWithNestedClosures(PsiElement scope,
                                          ProblemsHolder holder,
                                          StandardDataFlowRunner dfaRunner,
                                          Collection<DfaMemoryState> initialStates, final boolean onTheFly) {
  final DataFlowInstructionVisitor visitor = new DataFlowInstructionVisitor();
  final RunnerResult rc = dfaRunner.analyzeMethod(scope, visitor, IGNORE_ASSERT_STATEMENTS, initialStates);
  if (rc == RunnerResult.OK) {
    createDescription(dfaRunner, holder, visitor, onTheFly, scope);

    MultiMap<PsiElement,DfaMemoryState> nestedClosures = dfaRunner.getNestedClosures();
    for (PsiElement closure : nestedClosures.keySet()) {
      analyzeDfaWithNestedClosures(closure, holder, dfaRunner, nestedClosures.get(closure), onTheFly);
    }
  }
  else if (rc == RunnerResult.TOO_COMPLEX) {
    if (scope.getParent() instanceof PsiMethod) {
      PsiMethod method = (PsiMethod)scope.getParent();
      final PsiIdentifier name = method.getNameIdentifier();
      if (name != null) { // Might be null for synthetic methods like JSP page.
        holder.registerProblem(name, InspectionsBundle.message("dataflow.too.complex"), ProblemHighlightType.WEAK_WARNING);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:DataFlowInspectionBase.java

示例2: importFromSources

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
protected void importFromSources(File dir) {
  myRootDir = dir;
  try {
    myProject = doCreateProject(getIprFile());
    myBuilder.setBaseProjectPath(dir.getAbsolutePath());
    List<DetectedRootData> list = RootDetectionProcessor.detectRoots(dir);
    MultiMap<ProjectStructureDetector,DetectedProjectRoot> map = RootDetectionProcessor.createRootsMap(list);
    myBuilder.setupProjectStructure(map);
    for (ProjectStructureDetector detector : map.keySet()) {
      List<ModuleWizardStep> steps = detector.createWizardSteps(myBuilder, myBuilder.getProjectDescriptor(detector), EmptyIcon.ICON_16);
      for (ModuleWizardStep step : steps) {
        if (step instanceof AbstractStepWithProgress<?>) {
          performStep((AbstractStepWithProgress<?>)step);
        }
      }
    }
    myBuilder.commit(myProject, null, ModulesProvider.EMPTY_MODULES_PROVIDER);
  }
  catch (Exception e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ImportFromSourcesTestCase.java

示例3: collectConflicts

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
public static void collectConflicts(final PsiReference reference,
                                    final PsiElement element,
                                    final Map<Language, InlineHandler.Inliner> inliners,
                                    final MultiMap<PsiElement, String> conflicts) {
  final PsiElement referenceElement = reference.getElement();
  if (referenceElement == null) return;
  final Language language = referenceElement.getLanguage();
  final InlineHandler.Inliner inliner = inliners.get(language);
  if (inliner != null) {
    final MultiMap<PsiElement, String> refConflicts = inliner.getConflicts(reference, element);
    if (refConflicts != null) {
      for (PsiElement psiElement : refConflicts.keySet()) {
        conflicts.putValues(psiElement, refConflicts.get(psiElement));
      }
    }
  }
  else {
    conflicts.putValue(referenceElement, "Cannot inline reference from " + language.getDisplayName());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:GenericInlineHandler.java

示例4: getProjectUsages

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@NotNull
@Override
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) throws CollectUsagesException {
  VcsLogManager logManager = VcsLogContentProvider.findLogManager(project);
  VisiblePack dataPack = getDataPack(logManager);
  if (dataPack != null) {
    PermanentGraph<Integer> permanentGraph = dataPack.getPermanentGraph();
    MultiMap<VcsKey, VirtualFile> groupedRoots = groupRootsByVcs(dataPack.getLogProviders());

    Set<UsageDescriptor> usages = ContainerUtil.newHashSet();
    usages.add(new UsageDescriptor("vcs.log.commit.count", permanentGraph.getAllCommits().size()));
    for (VcsKey vcs : groupedRoots.keySet()) {
      //noinspection StringToUpperCaseOrToLowerCaseWithoutLocale
      usages.add(new UsageDescriptor("vcs.log." + vcs.getName().toLowerCase() + ".root.count", groupedRoots.get(vcs).size()));
    }
    return usages;
  }
  return Collections.emptySet();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:VcsLogRepoSizeCollector.java

示例5: processCandidates

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
private boolean processCandidates(@NotNull final Map<RequestWithProcessor, Processor<PsiElement>> localProcessors,
                                  @NotNull final MultiMap<VirtualFile, RequestWithProcessor> candidateFiles,
                                  @NotNull ProgressIndicator progress,
                                  int totalSize,
                                  int alreadyProcessedFiles) {
  List<VirtualFile> files = new ArrayList<VirtualFile>(candidateFiles.keySet());

  return processPsiFileRoots(files, totalSize, alreadyProcessedFiles, progress, new Processor<PsiFile>() {
    @Override
    public boolean process(final PsiFile psiRoot) {
      final VirtualFile vfile = psiRoot.getVirtualFile();
      for (final RequestWithProcessor singleRequest : candidateFiles.get(vfile)) {
        Processor<PsiElement> localProcessor = localProcessors.get(singleRequest);
        if (!localProcessor.process(psiRoot)) {
          return false;
        }
      }
      return true;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:PsiSearchHelperImpl.java

示例6: convertDescription

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@NotNull
private static MultiMap<PsiElement, String> convertDescription(
  @NotNull final MultiMap<PyClass, PyMemberInfo<?>> duplicateConflictDescriptions,
  @NotNull final Collection<PyMemberInfo<?>> dependenciesConflicts) {
  final MultiMap<PsiElement, String> result = new MultiMap<PsiElement, String>();
  for (final PyClass aClass : duplicateConflictDescriptions.keySet()) {
    for (final PyMemberInfo<?> pyMemberInfo : duplicateConflictDescriptions.get(aClass)) {
      final String message = RefactoringBundle.message("0.already.contains.a.1",
                                                       RefactoringUIUtil.getDescription(aClass, false),
                                                       RefactoringUIUtil.getDescription(pyMemberInfo.getMember(), false));
      result.putValue(aClass, message);
    }
  }

  for (final PyMemberInfo<?> memberUnderConflict : dependenciesConflicts) {
    result.putValue(memberUnderConflict.getMember(), PyBundle.message(
                      "refactoring.will.not.be.accessible",
                      RefactoringUIUtil.getDescription(memberUnderConflict.getMember(), false)
                    )
    );
  }


  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:MembersConflictDialog.java

示例7: apply

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@CalledInAwt
@Override
public void apply(MultiMap<VirtualFile, AbstractFilePatchInProgress> patchGroups,
                  LocalChangeList localList,
                  String fileName,
                  TransparentlyFailedValueI<Map<String, Map<String, CharSequence>>, PatchSyntaxException> additionalInfo) {
  final Collection<PatchApplier> appliers = new LinkedList<PatchApplier>();
  final CommitContext commitContext = new CommitContext();
  applyAdditionalInfoBefore(myProject, additionalInfo, commitContext);

  for (VirtualFile base : patchGroups.keySet()) {
    final PatchApplier patchApplier =
      new PatchApplier<BinaryFilePatch>(myProject, base, ObjectsConvertor.convert(patchGroups.get(base),
                                                                                  new Convertor<AbstractFilePatchInProgress, FilePatch>() {
                                                                                    public FilePatch convert(AbstractFilePatchInProgress o) {
                                                                                    return o.getPatch();
                                                                                  }
                                                                                }), localList, null, commitContext);
    appliers.add(patchApplier);
  }
  if (PatchApplier.executePatchGroup(appliers, localList) != ApplyPatchStatus.ABORT) {
    applyAdditionalInfo(myProject, additionalInfo, commitContext);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ApplyPatchDefaultExecutor.java

示例8: processIncludingFiles

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@Override
public void processIncludingFiles(PsiFile context, Processor<Pair<VirtualFile, FileIncludeInfo>> processor) {
  context = context.getOriginalFile();
  VirtualFile contextFile = context.getVirtualFile();
  if (contextFile == null) return;
  MultiMap<VirtualFile,FileIncludeInfoImpl> infoList = FileIncludeIndex.getIncludingFileCandidates(context.getName(), GlobalSearchScope.allScope(myProject));
  for (VirtualFile candidate : infoList.keySet()) {
    PsiFile psiFile = myPsiManager.findFile(candidate);
    if (psiFile == null || context.equals(psiFile)) continue;
    for (FileIncludeInfo info : infoList.get(candidate)) {
      PsiFileSystemItem item = resolveFileInclude(info, psiFile);
      if (item != null && contextFile.equals(item.getVirtualFile())) {
        if (!processor.process(Pair.create(candidate, info))) {
          return;
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:FileIncludeManagerImpl.java

示例9: buildSwitchedFiles

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
private void buildSwitchedFiles(final MultiMap<String, VirtualFile> switchedFiles) {
  ChangesBrowserNode baseNode = ChangesBrowserNode.create(myProject, ChangesBrowserNode.SWITCHED_FILES_TAG);
  model.insertNodeInto(baseNode, root, root.getChildCount());
  for(String branchName: switchedFiles.keySet()) {
    final List<VirtualFile> switchedFileList = new ArrayList<VirtualFile>(switchedFiles.get(branchName));
    if (switchedFileList.size() > 0) {
      ChangesBrowserNode branchNode = ChangesBrowserNode.create(myProject, branchName);
      model.insertNodeInto(branchNode, baseNode, baseNode.getChildCount());

      final ChangesGroupingPolicy policy = createGroupingPolicy();
      Collections.sort(switchedFileList, VirtualFileHierarchicalComparator.getInstance());
      for (VirtualFile file : switchedFileList) {
        insertChangeNode(file, policy, branchNode, defaultNodeCreator(file));
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:TreeModelBuilder.java

示例10: mergeByUnknowns

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@Nullable
public List<DfaMemoryStateImpl> mergeByUnknowns(List<DfaMemoryStateImpl> states) {
  MultiMap<Integer, DfaMemoryStateImpl> byHash = new MultiMap<Integer, DfaMemoryStateImpl>();
  for (DfaMemoryStateImpl state : states) {
    ProgressManager.checkCanceled();
    byHash.putValue(state.getPartialHashCode(false, true), state);
  }

  Replacements replacements = new Replacements(states);
  for (Integer key : byHash.keySet()) {
    Collection<DfaMemoryStateImpl> similarStates = byHash.get(key);
    if (similarStates.size() < 2) continue;
    
    for (final DfaMemoryStateImpl state1 : similarStates) {
      ProgressManager.checkCanceled();
      List<DfaMemoryStateImpl> complementary = ContainerUtil.filter(similarStates, new Condition<DfaMemoryStateImpl>() {
        @Override
        public boolean value(DfaMemoryStateImpl state2) {
          return state1.equalsByRelations(state2) && state1.equalsByVariableStates(state2);
        }
      });
      if (mergeUnknowns(replacements, complementary)) break;
    }
  }

  return replacements.getMergeResult();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:StateMerger.java

示例11: mergeByNullability

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@Nullable
public List<DfaMemoryStateImpl> mergeByNullability(List<DfaMemoryStateImpl> states) {
  MultiMap<Integer, DfaMemoryStateImpl> byHash = new MultiMap<Integer, DfaMemoryStateImpl>();
  for (DfaMemoryStateImpl state : states) {
    ProgressManager.checkCanceled();
    byHash.putValue(state.getPartialHashCode(false, false), state);
  }

  Replacements replacements = new Replacements(states);
  for (Integer key : byHash.keySet()) {
    Collection<DfaMemoryStateImpl> similarStates = byHash.get(key);
    if (similarStates.size() < 2) continue;
    
    groupLoop:
    for (final DfaMemoryStateImpl state1 : similarStates) {
      ProgressManager.checkCanceled();
      for (final DfaVariableValue var : state1.getChangedVariables()) {
        if (state1.getVariableState(var).getNullability() != Nullness.NULLABLE) {
          continue;
        }
        
        List<DfaMemoryStateImpl> complementary = ContainerUtil.filter(similarStates, new Condition<DfaMemoryStateImpl>() {
          @Override
          public boolean value(DfaMemoryStateImpl state2) {
            return state1.equalsByRelations(state2) &&
                   areEquivalentModuloVar(state1, state2, var) &&
                   areVarStatesEqualModuloNullability(state1, state2, var);
          }
        });
        if (mergeUnknowns(replacements, complementary)) break groupLoop;
      }
    }
  }

  return replacements.getMergeResult();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:StateMerger.java

示例12: main

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
  File root = new File("/Users/max/IDEA/out/classes/production/");
  final MultiMap<Couple<Integer>, String> dimToPath = new MultiMap<Couple<Integer>, String>();

  walk(root, dimToPath, root);

  ArrayList<Couple<Integer>> keys = new ArrayList<Couple<Integer>>(dimToPath.keySet());
  Collections.sort(keys, new Comparator<Couple<Integer>>() {
    @Override
    public int compare(Couple<Integer> o1, Couple<Integer> o2) {
      int d0 = dimToPath.get(o2).size() - dimToPath.get(o1).size();
      if (d0 != 0) return d0;
      int d1 = o1.first - o2.first;
      if (d1 != 0) {
        return d1;
      }
      return o1.second - o2.second;
    }
  });

  int total = 0;
  for (Couple<Integer> key : keys) {
    Collection<String> paths = dimToPath.get(key);
    System.out.println("------------------------   " + key.first + "x" + key.second + "  (total " +paths.size() + " icons) --------------------------------");
    for (String path : paths) {
      System.out.println(path);
      total ++;
    }
    System.out.println("");
  }

  System.out.println("Total icons: " + total);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:BuildIcons.java

示例13: getAllPackagePrefixes

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
private static Collection<String> getAllPackagePrefixes(final GlobalSearchScope scope, final MultiMap<String, Module> map) {
  if (scope == null) return map.keySet();

  List<String> result = new SmartList<String>();
  for (final String prefix : map.keySet()) {
    modules: for (final Module module : map.get(prefix)) {
      if (scope.isSearchInModuleContent(module)) {
        result.add(prefix);
        break modules;
      }
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:PackagePrefixIndex.java

示例14: convertMap

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
private static Map<String, PsiMethod[]> convertMap(MultiMap<String, PsiMethod> multiMap) {
  Map<String, PsiMethod[]> res = new HashMap<String, PsiMethod[]>();

  for (String methodName : multiMap.keySet()) {
    Collection<PsiMethod> m = multiMap.get(methodName);
    res.put(methodName, m.toArray(new PsiMethod[m.size()]));
  }

  return res;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:DynamicMemberUtils.java

示例15: buildItems

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
private List<TemplateItem> buildItems(MultiMap<TemplatesGroup, ProjectTemplate> map) {
  List<TemplateItem> items = new ArrayList<TemplateItem>();
  List<TemplatesGroup> groups = new ArrayList<TemplatesGroup>(map.keySet());
  Collections.sort(groups);
  for (TemplatesGroup group : groups) {
    for (ProjectTemplate template : map.get(group)) {
      TemplateItem templateItem = new TemplateItem(template, group);
      items.add(templateItem);
    }
  }
  return items;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ProjectTypesList.java


注:本文中的com.intellij.util.containers.MultiMap.keySet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。