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


Java Instruction.getIndex方法代码示例

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


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

示例1: MyGraph

import com.intellij.codeInspection.dataFlow.instructions.Instruction; //导入方法依赖的package包/类
private MyGraph(@NotNull ControlFlow flow) {
  myFlow = flow;
  myInstructions = flow.getInstructions();
  for (Instruction instruction : myInstructions) {
    int fromIndex = instruction.getIndex();
    int[] to = next(fromIndex, myInstructions);
    for (int toIndex : to) {
      int[] froms = myIns.get(toIndex);
      if (froms == null) {
        froms = new int[]{fromIndex};
        myIns.put(toIndex, froms);
      }
      else {
        froms = ArrayUtil.append(froms, fromIndex);
        myIns.put(toIndex, froms);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:LoopAnalyzer.java

示例2: MyGraph

import com.intellij.codeInspection.dataFlow.instructions.Instruction; //导入方法依赖的package包/类
private MyGraph(@NotNull ControlFlow flow)
{
	myFlow = flow;
	myInstructions = flow.getInstructions();
	for(Instruction instruction : myInstructions)
	{
		int fromIndex = instruction.getIndex();
		int[] to = getSuccessorIndices(fromIndex, myInstructions);
		for(int toIndex : to)
		{
			int[] froms = myIns.get(toIndex);
			if(froms == null)
			{
				froms = new int[]{fromIndex};
				myIns.put(toIndex, froms);
			}
			else
			{
				froms = ArrayUtil.append(froms, fromIndex);
				myIns.put(toIndex, froms);
			}
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:25,代码来源:LoopAnalyzer.java

示例3: calcForwardMap

import com.intellij.codeInspection.dataFlow.instructions.Instruction; //导入方法依赖的package包/类
private MultiMap<Instruction, Instruction> calcForwardMap()
{
	MultiMap<Instruction, Instruction> result = MultiMap.create();
	for(Instruction instruction : myInstructions)
	{
		if(isInterestingInstruction(instruction))
		{
			for(Instruction next : getSuccessors(instruction))
			{
				while(true)
				{
					if(isInterestingInstruction(next))
					{
						result.putValue(instruction, next);
						break;
					}
					if(next.getIndex() + 1 >= myInstructions.length)
					{
						break;
					}
					next = myInstructions[next.getIndex() + 1];
				}
			}
		}
	}
	return result;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:28,代码来源:LiveVariablesAnalyzer.java

示例4: getOut

import com.intellij.codeInspection.dataFlow.instructions.Instruction; //导入方法依赖的package包/类
@Override
public Iterator<Instruction> getOut(Instruction instruction)
{
	int fromIndex = instruction.getIndex();
	int[] next = getSuccessorIndices(fromIndex, myInstructions);
	return indicesToInstructions(next);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:8,代码来源:LoopAnalyzer.java

示例5: getOut

import com.intellij.codeInspection.dataFlow.instructions.Instruction; //导入方法依赖的package包/类
@Override
public Iterator<Instruction> getOut(Instruction instruction) {
  int fromIndex = instruction.getIndex();
  int[] next = next(fromIndex, myInstructions);
  return indicesToInstructions(next);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:LoopAnalyzer.java

示例6: inSameLoop

import com.intellij.codeInspection.dataFlow.instructions.Instruction; //导入方法依赖的package包/类
private static boolean inSameLoop(@NotNull Instruction prevInstruction, @NotNull Instruction nextInstruction, @NotNull int[] loopNumber)
{
	return loopNumber[nextInstruction.getIndex()] == loopNumber[prevInstruction.getIndex()];
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:5,代码来源:DataFlowRunner.java


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