當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。