Java Code Examples for com.intellij.util.containers.MultiMap#containsKey()

The following examples show how to use com.intellij.util.containers.MultiMap#containsKey() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RootIndex.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Nonnull
private LinkedHashSet<OrderEntry> getLibraryOrderEntries(@Nonnull List<VirtualFile> hierarchy,
                                                         @Nullable VirtualFile libraryClassRoot,
                                                         @Nullable VirtualFile librarySourceRoot,
                                                         @Nonnull MultiMap<VirtualFile, OrderEntry> libClassRootEntries,
                                                         @Nonnull MultiMap<VirtualFile, OrderEntry> libSourceRootEntries) {
  LinkedHashSet<OrderEntry> orderEntries = ContainerUtil.newLinkedHashSet();
  for (VirtualFile root : hierarchy) {
    if (root == libraryClassRoot && !sourceRootOf.containsKey(root)) {
      orderEntries.addAll(libClassRootEntries.get(root));
    }
    if (root == librarySourceRoot && libraryClassRoot == null) {
      orderEntries.addAll(libSourceRootEntries.get(root));
    }
    if (libClassRootEntries.containsKey(root) || sourceRootOf.containsKey(root) && librarySourceRoot == null) {
      break;
    }
  }
  return orderEntries;
}
 
Example 2
Source File: RootIndex.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nullable
private ModuleSourceOrderEntry getModuleSourceEntry(@Nonnull List<VirtualFile> hierarchy, @Nonnull VirtualFile moduleContentRoot, @Nonnull 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;
}