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


Java FileBasedIndex.getValues方法代码示例

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


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

示例1: collectSingleEquation

import com.intellij.util.indexing.FileBasedIndex; //导入方法依赖的package包/类
private void collectSingleEquation(HKey hKey, Solver solver, @NotNull Map<Bytes, List<HEquations>> cache) throws EquationsLimitException {
  GlobalSearchScope librariesScope = ProjectScope.getLibrariesScope(myProject);

  FileBasedIndex index = FileBasedIndex.getInstance();

  ProgressManager.checkCanceled();
  Bytes bytes = new Bytes(hKey.key);

  List<HEquations> hEquationss = cache.get(bytes);
  if (hEquationss == null) {
    hEquationss = index.getValues(BytecodeAnalysisIndex.NAME, bytes, librariesScope);
    cache.put(bytes, hEquationss);
  }

  for (HEquations hEquations : hEquationss) {
    boolean stable = hEquations.stable;
    for (DirectionResultPair pair : hEquations.results) {
      int dirKey = pair.directionKey;
      if (dirKey == hKey.dirKey) {
        HResult result = pair.hResult;
        solver.addEquation(new HEquation(new HKey(bytes.bytes, dirKey, stable, false), result));
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:ProjectBytecodeAnalysis.java

示例2: matchContentType

import com.intellij.util.indexing.FileBasedIndex; //导入方法依赖的package包/类
@Override
protected Boolean matchContentType(PsiElement psiElement, String variableName, ProcessingContext context)
{
    if (!variableName.equals("content")) {
        return false;
    }

    FileBasedIndex instance = FileBasedIndex.getInstance();

    String canonicalPath = psiElement
            .getContainingFile()
            .getOriginalFile()
            .getVirtualFile()
            .getCanonicalPath();

    if (canonicalPath == null) {
        return false;
    }

    GlobalSearchScope globalSearchScope = GlobalSearchScope.allScope(psiElement.getProject());

    List<String> values = instance.getValues(YamlContentTypeIndex.KEY, canonicalPath, globalSearchScope);
    if (values.size() != 1) {
        return false;
    }

    context.put("contentTypeIdentifier", values.get(0));
    return true;
}
 
开发者ID:whitefire,项目名称:eZ-completion,代码行数:30,代码来源:YamlContentTypeMatcher.java

示例3: readProperty

import com.intellij.util.indexing.FileBasedIndex; //导入方法依赖的package包/类
@Nullable
private String readProperty(FileBasedIndex fileBasedIndex, GlobalSearchScope searchScope, String directoryName, ConfigKey configKey) {
  final ConfigIndexKey configIndexKey = new ConfigIndexKey(directoryName, configKey.getConfigKey());
  final List<String> values = fileBasedIndex.getValues(LombokConfigIndex.NAME, configIndexKey, searchScope);
  if (!values.isEmpty()) {
    return values.iterator().next();
  }
  return null;
}
 
开发者ID:mplushnikov,项目名称:lombok-intellij-plugin,代码行数:10,代码来源:ConfigDiscovery.java

示例4: collectSingleEquation

import com.intellij.util.indexing.FileBasedIndex; //导入方法依赖的package包/类
private void collectSingleEquation(HKey hKey, Solver solver, @NotNull Map<Bytes, List<HEquations>> cache) throws EquationsLimitException
{
	GlobalSearchScope librariesScope = ProjectScope.getLibrariesScope(myProject);

	FileBasedIndex index = FileBasedIndex.getInstance();

	ProgressManager.checkCanceled();
	Bytes bytes = new Bytes(hKey.key);

	List<HEquations> hEquationss = cache.get(bytes);
	if(hEquationss == null)
	{
		hEquationss = index.getValues(BytecodeAnalysisIndex.NAME, bytes, librariesScope);
		cache.put(bytes, hEquationss);
	}

	for(HEquations hEquations : hEquationss)
	{
		boolean stable = hEquations.stable;
		for(DirectionResultPair pair : hEquations.results)
		{
			int dirKey = pair.directionKey;
			if(dirKey == hKey.dirKey)
			{
				HResult result = pair.hResult;
				solver.addEquation(new HEquation(new HKey(bytes.bytes, dirKey, stable, false), result));
			}
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:31,代码来源:ProjectBytecodeAnalysis.java

示例5: collectEquations

import com.intellij.util.indexing.FileBasedIndex; //导入方法依赖的package包/类
private void collectEquations(List<HKey> keys, Solver solver, @NotNull Map<Bytes, List<HEquations>> cache) throws EquationsLimitException {

    GlobalSearchScope librariesScope = ProjectScope.getLibrariesScope(myProject);
    HashSet<HKey> queued = new HashSet<HKey>();
    Stack<HKey> queue = new Stack<HKey>();

    for (HKey key : keys) {
      queue.push(key);
      queued.add(key);
    }

    FileBasedIndex index = FileBasedIndex.getInstance();

    while (!queue.empty()) {
      if (queued.size() > EQUATIONS_LIMIT) {
        throw new EquationsLimitException();
      }
      ProgressManager.checkCanceled();
      HKey hKey = queue.pop();
      Bytes bytes = new Bytes(hKey.key);

      List<HEquations> hEquationss = cache.get(bytes);
      if (hEquationss == null) {
        hEquationss = index.getValues(BytecodeAnalysisIndex.NAME, bytes, librariesScope);
        cache.put(bytes, hEquationss);
      }

      for (HEquations hEquations : hEquationss) {
        boolean stable = hEquations.stable;
        for (DirectionResultPair pair : hEquations.results) {
          int dirKey = pair.directionKey;
          if (dirKey == hKey.dirKey) {
            HResult result = pair.hResult;

            solver.addEquation(new HEquation(new HKey(bytes.bytes, dirKey, stable, false), result));
            if (result instanceof HPending) {
              HPending pending = (HPending)result;
              for (HComponent component : pending.delta) {
                for (HKey depKey : component.ids) {
                  if (!queued.contains(depKey)) {
                    queue.push(depKey);
                    queued.add(depKey);
                  }
                }
              }
            }
          }
        }
      }
    }
  }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:52,代码来源:ProjectBytecodeAnalysis.java

示例6: collectPurityEquations

import com.intellij.util.indexing.FileBasedIndex; //导入方法依赖的package包/类
private void collectPurityEquations(HKey key, PuritySolver puritySolver, Map<Bytes, List<HEquations>> cache) throws EquationsLimitException
{
	GlobalSearchScope librariesScope = ProjectScope.getLibrariesScope(myProject);
	HashSet<HKey> queued = new HashSet<HKey>();
	Stack<HKey> queue = new Stack<HKey>();

	queue.push(key);
	queued.add(key);

	FileBasedIndex index = FileBasedIndex.getInstance();

	while(!queue.empty())
	{
		if(queued.size() > EQUATIONS_LIMIT)
		{
			throw new EquationsLimitException();
		}
		ProgressManager.checkCanceled();
		HKey hKey = queue.pop();
		Bytes bytes = new Bytes(hKey.key);

		List<HEquations> hEquationss = cache.get(bytes);
		if(hEquationss == null)
		{
			hEquationss = index.getValues(BytecodeAnalysisIndex.NAME, bytes, librariesScope);
			cache.put(bytes, hEquationss);
		}

		for(HEquations hEquations : hEquationss)
		{
			boolean stable = hEquations.stable;
			for(DirectionResultPair pair : hEquations.results)
			{
				int dirKey = pair.directionKey;
				if(dirKey == hKey.dirKey)
				{
					Set<HEffectQuantum> effects = ((HEffects) pair.hResult).effects;
					puritySolver.addEquation(new HKey(bytes.bytes, dirKey, stable, false), effects);
					for(HEffectQuantum effect : effects)
					{
						if(effect instanceof HEffectQuantum.CallQuantum)
						{
							HKey depKey = ((HEffectQuantum.CallQuantum) effect).key;
							if(!queued.contains(depKey))
							{
								queue.push(depKey);
								queued.add(depKey);
							}
						}
					}
				}
			}
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:56,代码来源:ProjectBytecodeAnalysis.java

示例7: collectEquations

import com.intellij.util.indexing.FileBasedIndex; //导入方法依赖的package包/类
private void collectEquations(List<HKey> keys, Solver solver, @NotNull Map<Bytes, List<HEquations>> cache) throws EquationsLimitException
{

	GlobalSearchScope librariesScope = ProjectScope.getLibrariesScope(myProject);
	HashSet<HKey> queued = new HashSet<HKey>();
	Stack<HKey> queue = new Stack<HKey>();

	for(HKey key : keys)
	{
		queue.push(key);
		queued.add(key);
	}

	FileBasedIndex index = FileBasedIndex.getInstance();

	while(!queue.empty())
	{
		if(queued.size() > EQUATIONS_LIMIT)
		{
			throw new EquationsLimitException();
		}
		ProgressManager.checkCanceled();
		HKey hKey = queue.pop();
		Bytes bytes = new Bytes(hKey.key);

		List<HEquations> hEquationss = cache.get(bytes);
		if(hEquationss == null)
		{
			hEquationss = index.getValues(BytecodeAnalysisIndex.NAME, bytes, librariesScope);
			cache.put(bytes, hEquationss);
		}

		for(HEquations hEquations : hEquationss)
		{
			boolean stable = hEquations.stable;
			for(DirectionResultPair pair : hEquations.results)
			{
				int dirKey = pair.directionKey;
				if(dirKey == hKey.dirKey)
				{
					HResult result = pair.hResult;

					solver.addEquation(new HEquation(new HKey(bytes.bytes, dirKey, stable, false), result));
					if(result instanceof HPending)
					{
						HPending pending = (HPending) result;
						for(HComponent component : pending.delta)
						{
							for(HKey depKey : component.ids)
							{
								if(!queued.contains(depKey))
								{
									queue.push(depKey);
									queued.add(depKey);
								}
							}
						}
					}
				}
			}
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:64,代码来源:ProjectBytecodeAnalysis.java


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