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