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


Java TIntArrayList.forEach方法代码示例

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


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

示例1: calcInLoop

import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
static int[] calcInLoop(ControlFlow controlFlow) {
  final int[] loop = new int[controlFlow.getInstructionCount()]; // loop[i] = loop number(strongly connected component number) of i-th instruction or 0 if outside loop

  MyGraph graph = new MyGraph(controlFlow);
  final DFSTBuilder<Instruction> builder = new DFSTBuilder<Instruction>(graph);
  TIntArrayList sccs = builder.getSCCs();
  sccs.forEach(new TIntProcedure() {
    private int myTNumber;
    private int component;

    @Override
    public boolean execute(int size) {
      int value = size > 1 ? ++component : 0;
      for (int i = 0; i < size; i++) {
        Instruction instruction = builder.getNodeByTNumber(myTNumber + i);
        loop[instruction.getIndex()] = value;
      }
      myTNumber += size;
      return true;
    }
  });

  return loop;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:LoopAnalyzer.java

示例2: buildChunks

import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
public static <Node> List<Chunk<Node>> buildChunks(Graph<Node> graph) {
  final DFSTBuilder<Node> dfstBuilder = new DFSTBuilder<Node>(graph);
  final TIntArrayList sccs = dfstBuilder.getSCCs();
  final List<Chunk<Node>> chunks = new ArrayList<Chunk<Node>>();
  sccs.forEach(new TIntProcedure() {
    int myTNumber = 0;
    public boolean execute(int size) {
      Set<Node> packs = new LinkedHashSet<Node>();
      for (int j = 0; j < size; j++) {
        packs.add(dfstBuilder.getNodeByTNumber(myTNumber + j));
      }
      chunks.add(new Chunk<Node>(packs));
      myTNumber += size;
      return true;
    }
  });

  return chunks;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:CyclicDependenciesUtil.java

示例3: IntroduceParameterSettingsUI

import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
public IntroduceParameterSettingsUI(PsiLocalVariable onLocalVariable,
                                    PsiExpression onExpression,
                                    PsiMethod methodToReplaceIn,
                                    TIntArrayList parametersToRemove) {
  myHasInitializer = onLocalVariable != null && onLocalVariable.getInitializer() != null;
  myIsInvokedOnDeclaration = onExpression == null;
  final PsiParameter[] parameters = methodToReplaceIn.getParameterList().getParameters();
  myParametersToRemove = new PsiParameter[parameters.length];
  myParametersToRemoveChecked = new boolean[parameters.length];
  parametersToRemove.forEach(new TIntProcedure() {
    public boolean execute(final int paramNum) {
      myParametersToRemove[paramNum] = parameters[paramNum];
      return true;
    }
  });
  myIsLocalVariable = onLocalVariable != null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:IntroduceParameterSettingsUI.java

示例4: removeParametersFromCall

import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
private static void removeParametersFromCall(final GrClosureSignatureUtil.ArgInfo<PsiElement>[] actualArgs,final TIntArrayList parametersToRemove) {
  parametersToRemove.forEach(new TIntProcedure() {
    @Override
    public boolean execute(final int paramNum) {
      try {
        final GrClosureSignatureUtil.ArgInfo<PsiElement> actualArg = actualArgs[paramNum];
        if (actualArg == null) return true;
        for (PsiElement arg : actualArg.args) {
          arg.delete();
        }
      }
      catch (IncorrectOperationException e) {
        LOG.error(e);
      }
      return true;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:GroovyIntroduceParameterMethodUsagesProcessor.java

示例5: removeParametersFromCall

import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
public static void removeParametersFromCall(final GrClosureSignatureUtil.ArgInfo<PsiElement>[] actualArgs, final TIntArrayList parametersToRemove) {
  parametersToRemove.forEach(new TIntProcedure() {
    @Override
    public boolean execute(final int paramNum) {
      try {
        final GrClosureSignatureUtil.ArgInfo<PsiElement> actualArg = actualArgs[paramNum];
        for (PsiElement arg : actualArg.args) {
          arg.delete();
        }
      }
      catch (IncorrectOperationException e) {
        LOG.error(e);
      }
      return true;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:GroovyIntroduceParameterUtil.java

示例6: normalizeParameterIdxAccordingToRemovedParams

import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
private void normalizeParameterIdxAccordingToRemovedParams(TIntArrayList parametersToRemove) {
  parametersToRemove.forEach(new TIntProcedure() {
    @Override
    public boolean execute(int value) {
      if (myParameterIndex >= value) {
        myParameterIndex--;
      }
      return true;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:InplaceIntroduceParameterPopup.java


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