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


Java MostlySingularMultiMap类代码示例

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


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

示例1: doCollect

import com.intellij.util.containers.MostlySingularMultiMap; //导入依赖的package包/类
@NotNull
private List<AnnotationData> doCollect(@NotNull PsiModifierListOwner listOwner, boolean onlyWritable) {
  String externalName = getExternalName(listOwner, false);
  if (externalName == null) return NO_DATA;

  List<PsiFile> files = findExternalAnnotationsFiles(listOwner);
  if (files == null) return NO_DATA;

  SmartList<AnnotationData> result = new SmartList<AnnotationData>();
  for (PsiFile file : files) {
    if (!file.isValid()) continue;
    if (onlyWritable && !file.isWritable()) continue;

    MostlySingularMultiMap<String, AnnotationData> fileData = getDataFromFile(file);
    ContainerUtil.addAll(result, fileData.get(externalName));
  }
  if (result.isEmpty()) return NO_DATA;

  result.trimToSize();
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:BaseExternalAnnotationsManager.java

示例2: ensurePropertiesLoaded

import com.intellij.util.containers.MostlySingularMultiMap; //导入依赖的package包/类
private void ensurePropertiesLoaded() {
  while (myFileModificationStamp != myFile.getModificationStamp() || myPropertiesMap == null) {
    myFileModificationStamp = myFile.getModificationStamp();
    MostlySingularMultiMap<String, IProperty> propertiesMap = new MostlySingularMultiMap<String, IProperty>();
    XmlTag rootTag = myFile.getRootTag();
    final List<IProperty> propertiesOrder = new ArrayList<IProperty>();
    if (rootTag != null) {
      XmlTag[] entries = rootTag.findSubTags("entry");
      for (XmlTag entry : entries) {
        XmlProperty property = new XmlProperty(entry, this);
        propertiesOrder.add(property);
        propertiesMap.add(property.getKey(), property);
      }
    }
    final boolean isAlphaSorted = PropertiesImplUtil.isAlphaSorted(propertiesOrder);
    myAlphaSorted = isAlphaSorted;
    myProperties = propertiesOrder;
    myPropertiesMap = propertiesMap;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:XmlPropertiesFileImpl.java

示例3: ensurePropertiesLoaded

import com.intellij.util.containers.MostlySingularMultiMap; //导入依赖的package包/类
private void ensurePropertiesLoaded() {
  if (myPropertiesMap != null) return;

  final ASTNode[] props = getPropertiesList().getChildren(PropertiesElementTypes.PROPERTIES);
  MostlySingularMultiMap<String, IProperty> propertiesMap = new MostlySingularMultiMap<String, IProperty>();
  List<IProperty> properties = new ArrayList<IProperty>(props.length);
  for (final ASTNode prop : props) {
    final Property property = (Property)prop.getPsi();
    String key = property.getUnescapedKey();
    propertiesMap.add(key, property);
    properties.add(property);
  }
  final boolean isAlphaSorted = PropertiesImplUtil.isAlphaSorted(properties);
  synchronized (lock) {
    if (myPropertiesMap != null) return;
    myProperties = properties;
    myPropertiesMap = propertiesMap;
    myAlphaSorted = isAlphaSorted;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:PropertiesFileImpl.java

示例4: checkDuplicateMethod

import com.intellij.util.containers.MostlySingularMultiMap; //导入依赖的package包/类
@Nullable
static HighlightInfo checkDuplicateMethod(PsiClass aClass,
                                          @NotNull PsiMethod method,
                                          @NotNull MostlySingularMultiMap<MethodSignature, PsiMethod> duplicateMethods) {
  if (aClass == null || method instanceof ExternallyDefinedPsiElement) return null;
  MethodSignature methodSignature = method.getSignature(PsiSubstitutor.EMPTY);
  int methodCount = 1;
  List<PsiMethod> methods = (List<PsiMethod>)duplicateMethods.get(methodSignature);
  if (methods.size() > 1) {
    methodCount++;
  }

  if (methodCount == 1 && aClass.isEnum() &&
      GenericsHighlightUtil.isEnumSyntheticMethod(methodSignature, aClass.getProject())) {
    methodCount++;
  }
  if (methodCount > 1) {
    String description = JavaErrorMessages.message("duplicate.method",
                                               JavaHighlightUtil.formatMethod(method),
                                               HighlightUtil.formatClass(aClass));
    TextRange textRange = HighlightNamesUtil.getMethodDeclarationTextRange(method);
    return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(textRange).descriptionAndTooltip(description).create();
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:HighlightMethodUtil.java

示例5: ensurePropertiesLoaded

import com.intellij.util.containers.MostlySingularMultiMap; //导入依赖的package包/类
private void ensurePropertiesLoaded() {
  if (myPropertiesMap != null) return;

  final ASTNode[] props = getPropertiesList().getChildren(PropertiesElementTypes.PROPERTIES);
  MostlySingularMultiMap<String, IProperty> propertiesMap = new MostlySingularMultiMap<String, IProperty>();
  List<IProperty> properties = new ArrayList<IProperty>(props.length);
  for (final ASTNode prop : props) {
    final Property property = (Property)prop.getPsi();
    String key = property.getUnescapedKey();
    propertiesMap.add(key, property);
    properties.add(property);
  }
  synchronized (lock) {
    if (myPropertiesMap != null) return;
    myProperties = properties;
    myPropertiesMap = propertiesMap;
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:PropertiesFileImpl.java

示例6: getDuplicateMethods

import com.intellij.util.containers.MostlySingularMultiMap; //导入依赖的package包/类
@NotNull
private MostlySingularMultiMap<MethodSignature, PsiMethod> getDuplicateMethods(@NotNull PsiClass aClass)
{
	MostlySingularMultiMap<MethodSignature, PsiMethod> signatures = myDuplicateMethods.get(aClass);
	if(signatures == null)
	{
		signatures = new MostlySingularMultiMap<>();
		for(PsiMethod method : aClass.getMethods())
		{
			if(method instanceof ExternallyDefinedPsiElement)
			{
				continue; // ignore aspectj-weaved methods; they are checked elsewhere
			}
			MethodSignature signature = method.getSignature(PsiSubstitutor.EMPTY);
			signatures.add(signature, method);
		}

		myDuplicateMethods.put(aClass, signatures);
	}
	return signatures;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:22,代码来源:HighlightVisitorImpl.java

示例7: getResult

import com.intellij.util.containers.MostlySingularMultiMap; //导入依赖的package包/类
public MostlySingularMultiMap<String, AnnotationData> getResult() {
  if (myData.isEmpty()) {
    return MostlySingularMultiMap.emptyMap();
  }
  myData.compact();
  return myData;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:BaseExternalAnnotationsManager.java

示例8: compute

import com.intellij.util.containers.MostlySingularMultiMap; //导入依赖的package包/类
@Override
public Result<MostlySingularMultiMap<String, SymbolCollectingProcessor.ResultWithContext>> compute() {
  SymbolCollectingProcessor p = new SymbolCollectingProcessor();
  myFile.processDeclarationsNoGuess(p, ResolveState.initial(), myFile, myFile);
  MostlySingularMultiMap<String, SymbolCollectingProcessor.ResultWithContext> results = p.getResults();
  return Result.create(results, PsiModificationTracker.MODIFICATION_COUNT, myFile);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:PsiJavaFileBaseImpl.java

示例9: checkDuplicateMethod

import com.intellij.util.containers.MostlySingularMultiMap; //导入依赖的package包/类
@Nullable
static HighlightInfo checkDuplicateMethod(PsiClass aClass,
                                          @NotNull PsiMethod method,
                                          @NotNull MostlySingularMultiMap<MethodSignature, PsiMethod> duplicateMethods) {
  if (aClass == null || method instanceof ExternallyDefinedPsiElement) return null;
  MethodSignature methodSignature = method.getSignature(PsiSubstitutor.EMPTY);
  int methodCount = 1;
  List<PsiMethod> methods = (List<PsiMethod>)duplicateMethods.get(methodSignature);
  if (methods.size() > 1) {
    methodCount++;
  }

  if (methodCount == 1 && aClass.isEnum() &&
      GenericsHighlightUtil.isEnumSyntheticMethod(methodSignature, aClass.getProject())) {
    methodCount++;
  }
  if (methodCount > 1) {
    String description = JavaErrorMessages.message("duplicate.method",
                                               JavaHighlightUtil.formatMethod(method),
                                               HighlightUtil.formatClass(aClass));
    TextRange textRange = HighlightNamesUtil.getMethodDeclarationTextRange(method);
    return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).
      range(method, textRange.getStartOffset(), textRange.getEndOffset()).
      descriptionAndTooltip(description).create();
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:HighlightMethodUtil.java

示例10: getDuplicateMethods

import com.intellij.util.containers.MostlySingularMultiMap; //导入依赖的package包/类
@NotNull
private MostlySingularMultiMap<MethodSignature, PsiMethod> getDuplicateMethods(@NotNull PsiClass aClass) {
  MostlySingularMultiMap<MethodSignature, PsiMethod> signatures = myDuplicateMethods.get(aClass);
  if (signatures == null) {
    signatures = new MostlySingularMultiMap<MethodSignature, PsiMethod>();
    for (PsiMethod method : aClass.getMethods()) {
      if (method instanceof ExternallyDefinedPsiElement) continue; // ignore aspectj-weaved methods; they are checked elsewhere
      MethodSignature signature = method.getSignature(PsiSubstitutor.EMPTY);
      signatures.add(signature, method);
    }

    myDuplicateMethods.put(aClass, signatures);
  }
  return signatures;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:HighlightVisitorImpl.java

示例11: compute

import com.intellij.util.containers.MostlySingularMultiMap; //导入依赖的package包/类
@Override
public Result<MostlySingularMultiMap<String, SymbolCollectingProcessor.ResultWithContext>> compute() {
  SymbolCollectingProcessor p = new SymbolCollectingProcessor();
  myFile.processDeclarationsNoGuess(p, ResolveState.initial(), myFile, myFile);
  MostlySingularMultiMap<String, SymbolCollectingProcessor.ResultWithContext> results = p.getResults();
  return Result.create(results, PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:PsiJavaFileBaseImpl.java

示例12: getDuplicateMethods

import com.intellij.util.containers.MostlySingularMultiMap; //导入依赖的package包/类
@NotNull
private MostlySingularMultiMap<MethodSignature, PsiMethod> getDuplicateMethods(PsiClass aClass) {
  MostlySingularMultiMap<MethodSignature, PsiMethod> signatures = myDuplicateMethods.get(aClass);
  if (signatures == null) {
    signatures = new MostlySingularMultiMap<MethodSignature, PsiMethod>();
    for (PsiMethod method : aClass.getMethods()) {
      if (method instanceof ExternallyDefinedPsiElement) continue; // ignore aspectj-weaved methods; they are checked elsewhere
      MethodSignature signature = method.getSignature(PsiSubstitutor.EMPTY);
      signatures.add(signature, method);
    }

    myDuplicateMethods.put(aClass, signatures);
  }
  return signatures;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:HighlightVisitorImpl.java

示例13: doCollect

import com.intellij.util.containers.MostlySingularMultiMap; //导入依赖的package包/类
@NotNull
private List<AnnotationData> doCollect(@NotNull PsiModifierListOwner listOwner, boolean onlyWritable)
{
	String externalName = getExternalName(listOwner, false);
	if(externalName == null)
	{
		return NO_DATA;
	}

	List<PsiFile> files = findExternalAnnotationsFiles(listOwner);
	if(files == null)
	{
		return NO_DATA;
	}

	SmartList<AnnotationData> result = new SmartList<AnnotationData>();
	for(PsiFile file : files)
	{
		if(!file.isValid())
		{
			continue;
		}
		if(onlyWritable && !file.isWritable())
		{
			continue;
		}

		MostlySingularMultiMap<String, AnnotationData> fileData = getDataFromFile(file);
		ContainerUtil.addAll(result, fileData.get(externalName));
	}
	if(result.isEmpty())
	{
		return NO_DATA;
	}

	result.trimToSize();
	return result;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:39,代码来源:BaseExternalAnnotationsManager.java

示例14: getResult

import com.intellij.util.containers.MostlySingularMultiMap; //导入依赖的package包/类
public MostlySingularMultiMap<String, AnnotationData> getResult()
{
	if(myData.isEmpty())
	{
		return MostlySingularMultiMap.emptyMap();
	}
	myData.compact();
	return myData;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:10,代码来源:BaseExternalAnnotationsManager.java

示例15: compute

import com.intellij.util.containers.MostlySingularMultiMap; //导入依赖的package包/类
@Override
public Result<MostlySingularMultiMap<String, SymbolCollectingProcessor.ResultWithContext>> compute()
{
	SymbolCollectingProcessor p = new SymbolCollectingProcessor();
	myFile.processDeclarationsNoGuess(p, ResolveState.initial(), myFile, myFile);
	MostlySingularMultiMap<String, SymbolCollectingProcessor.ResultWithContext> results = p.getResults();
	return Result.create(results, PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:9,代码来源:PsiJavaFileBaseImpl.java


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