本文整理汇总了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));
}
}
}
}
示例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;
}
示例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;
}
示例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));
}
}
}
}
示例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);
}
}
}
}
}
}
}
}
}
示例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);
}
}
}
}
}
}
}
}
示例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);
}
}
}
}
}
}
}
}
}