本文整理汇总了Java中com.intellij.util.containers.HashMap.containsKey方法的典型用法代码示例。如果您正苦于以下问题:Java HashMap.containsKey方法的具体用法?Java HashMap.containsKey怎么用?Java HashMap.containsKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.containers.HashMap
的用法示例。
在下文中一共展示了HashMap.containsKey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findConstructorUsages
import com.intellij.util.containers.HashMap; //导入方法依赖的package包/类
@Nullable
private static Condition<PsiElement> findConstructorUsages(PsiMethod constructor, Collection<PsiReference> originalReferences, List<UsageInfo> usages,
final PsiElement[] allElementsToDelete) {
HashMap<PsiMethod, Collection<PsiReference>> constructorsToRefs = new HashMap<PsiMethod, Collection<PsiReference>>();
HashSet<PsiMethod> newConstructors = new HashSet<PsiMethod>();
if (isTheOnlyEmptyDefaultConstructor(constructor)) return null;
newConstructors.add(constructor);
constructorsToRefs.put(constructor, originalReferences);
HashSet<PsiMethod> passConstructors = new HashSet<PsiMethod>();
do {
passConstructors.clear();
for (PsiMethod method : newConstructors) {
final Collection<PsiReference> references = constructorsToRefs.get(method);
for (PsiReference reference : references) {
PsiMethod overridingConstructor = getOverridingConstructorOfSuperCall(reference.getElement());
if (overridingConstructor != null && !constructorsToRefs.containsKey(overridingConstructor)) {
Collection<PsiReference> overridingConstructorReferences = ReferencesSearch.search(overridingConstructor).findAll();
constructorsToRefs.put(overridingConstructor, overridingConstructorReferences);
passConstructors.add(overridingConstructor);
}
}
}
newConstructors.clear();
newConstructors.addAll(passConstructors);
}
while(!newConstructors.isEmpty());
final Set<PsiMethod> validOverriding =
validateOverridingMethods(constructor, originalReferences, constructorsToRefs.keySet(), constructorsToRefs, usages,
allElementsToDelete);
return new Condition<PsiElement>() {
public boolean value(PsiElement usage) {
if(usage instanceof PsiFile) return false;
return isInside(usage, allElementsToDelete) || isInside(usage, validOverriding);
}
};
}
示例2: sortUsages
import com.intellij.util.containers.HashMap; //导入方法依赖的package包/类
/**
* @param usages
* @return Map from elements to UsageHolders
*/
private static HashMap<PsiElement,UsageHolder> sortUsages(@NotNull UsageInfo[] usages) {
HashMap<PsiElement,UsageHolder> result = new HashMap<PsiElement, UsageHolder>();
for (final UsageInfo usage : usages) {
if (usage instanceof SafeDeleteUsageInfo) {
final PsiElement referencedElement = ((SafeDeleteUsageInfo)usage).getReferencedElement();
if (!result.containsKey(referencedElement)) {
result.put(referencedElement, new UsageHolder(referencedElement, usages));
}
}
}
return result;
}
示例3: buildRootsToFilesMap
import com.intellij.util.containers.HashMap; //导入方法依赖的package包/类
private Map<CvsRootProvider, ArrayList<File>> buildRootsToFilesMap() throws CannotFindCvsRootException {
HashMap<CvsRootProvider,ArrayList<File>> result = new HashMap<CvsRootProvider, ArrayList<File>>();
for (File file : myFiles) {
CvsRootProvider cvsRoot = CvsRootProvider.createOn(file);
if (cvsRoot == null) {
throw new CannotFindCvsRootException(file);
}
else {
if (!result.containsKey(cvsRoot)) result.put(cvsRoot, new ArrayList<File>());
(result.get(cvsRoot)).add(file);
}
}
return result;
}