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


Java MultiMap.containsKey方法代码示例

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


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

示例1: getLibraryOrderEntries

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@NotNull
private LinkedHashSet<OrderEntry> getLibraryOrderEntries(@NotNull List<VirtualFile> hierarchy,
                                                         @Nullable VirtualFile libraryClassRoot,
                                                         @Nullable VirtualFile librarySourceRoot,
                                                         @NotNull MultiMap<VirtualFile, OrderEntry> libClassRootEntries,
                                                         @NotNull MultiMap<VirtualFile, OrderEntry> libSourceRootEntries) {
  LinkedHashSet<OrderEntry> orderEntries = ContainerUtil.newLinkedHashSet();
  for (VirtualFile root : hierarchy) {
    if (root.equals(libraryClassRoot) && !sourceRootOf.containsKey(root)) {
      orderEntries.addAll(libClassRootEntries.get(root));
    }
    if (root.equals(librarySourceRoot) && libraryClassRoot == null) {
      orderEntries.addAll(libSourceRootEntries.get(root));
    }
    if (libClassRootEntries.containsKey(root) || sourceRootOf.containsKey(root) && librarySourceRoot == null) {
      break;
    }
  }
  return orderEntries;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:RootIndex.java

示例2: addImportElementDeclaration

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
private void addImportElementDeclaration(PyImportElement importElement,
                                         Map<String, PsiElement> localDeclarations,
                                         MultiMap<String, PsiElement> ambiguousDeclarations) {
  final String visibleName = importElement.getVisibleName();
  if (visibleName != null) {
    if (ambiguousDeclarations.containsKey(visibleName)) {
      ambiguousDeclarations.putValue(visibleName, importElement);
    }
    else if (localDeclarations.containsKey(visibleName)) {
      final PsiElement oldElement = localDeclarations.get(visibleName);
      ambiguousDeclarations.putValue(visibleName, oldElement);
      ambiguousDeclarations.putValue(visibleName, importElement);
    }
    else {
      localDeclarations.put(visibleName, importElement);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:PyFileImpl.java

示例3: checkAlive

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@NotNull
private SvnMergeInfoCache.MergeCheckResult checkAlive(@NotNull SvnChangeList list, @NotNull String branchPath) {
  final Info info = myVcs.getInfo(new File(branchPath));
  if (info == null || info.getURL() == null || !SVNPathUtil.isAncestor(myBranch.getUrl(), info.getURL().toString())) {
    return SvnMergeInfoCache.MergeCheckResult.NOT_MERGED;
  }

  final String subPathUnderBranch = SVNPathUtil.getRelativePath(myBranch.getUrl(), info.getURL().toString());
  MultiMap<SvnMergeInfoCache.MergeCheckResult, String> result = checkPaths(list, branchPath, subPathUnderBranch);

  if (result.containsKey(SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS)) {
    return SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS;
  }
  if (result.containsKey(SvnMergeInfoCache.MergeCheckResult.NOT_MERGED)) {
    myPartlyMerged.put(list.getNumber(), result.get(SvnMergeInfoCache.MergeCheckResult.NOT_MERGED));
    return SvnMergeInfoCache.MergeCheckResult.NOT_MERGED;
  }
  return SvnMergeInfoCache.MergeCheckResult.MERGED;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:BranchInfo.java

示例4: getModuleSourceEntry

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@Nullable
private ModuleSourceOrderEntry getModuleSourceEntry(@NotNull List<VirtualFile> hierarchy,
                                                    @NotNull VirtualFile moduleContentRoot,
                                                    @NotNull MultiMap<VirtualFile, OrderEntry> libClassRootEntries) {
  Module module = contentRootOf.get(moduleContentRoot);
  for (VirtualFile root : hierarchy) {
    if (sourceRootOf.get(root).contains(module)) {
      return ContainerUtil.findInstance(ModuleRootManager.getInstance(module).getOrderEntries(), ModuleSourceOrderEntry.class);
    }
    if (libClassRootEntries.containsKey(root)) {
      return null;
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:RootIndex.java

示例5: getIndexer

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@NotNull
@Override
public DataIndexer<Integer, Void, FileContent> getIndexer() {
  final MultiMap<FileType, Pair<ElementPattern<FileContent>, Integer>> detectors = new MultiMap<FileType, Pair<ElementPattern<FileContent>, Integer>>();
  for (FrameworkDetector detector : FrameworkDetector.EP_NAME.getExtensions()) {
    detectors.putValue(detector.getFileType(), Pair.create(detector.createSuitableFilePattern(), myRegistry.getDetectorId(detector)));
  }
  return new DataIndexer<Integer, Void, FileContent>() {
    @NotNull
    @Override
    public Map<Integer, Void> map(@NotNull FileContent inputData) {
      final FileType fileType = inputData.getFileType();
      if (!detectors.containsKey(fileType)) {
        return Collections.emptyMap();
      }
      Map<Integer, Void> result = null;
      for (Pair<ElementPattern<FileContent>, Integer> pair : detectors.get(fileType)) {
        if (pair.getFirst().accepts(inputData)) {
          if (LOG.isDebugEnabled()) {
            LOG.debug(inputData.getFile() + " accepted by detector " + pair.getSecond());
          }
          if (result == null) {
            result = new HashMap<Integer, Void>();
          }
          myDispatcher.getMulticaster().fileUpdated(inputData.getFile(), pair.getSecond());
          result.put(pair.getSecond(), null);
        }
      }
      return result != null ? result : Collections.<Integer, Void>emptyMap();
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:FrameworkDetectionIndex.java


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