本文整理汇总了Java中gnu.trove.TIntProcedure类的典型用法代码示例。如果您正苦于以下问题:Java TIntProcedure类的具体用法?Java TIntProcedure怎么用?Java TIntProcedure使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TIntProcedure类属于gnu.trove包,在下文中一共展示了TIntProcedure类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getReachable
import gnu.trove.TIntProcedure; //导入依赖的package包/类
private static LinkedHashSet<Integer> getReachable(final LinkedHashSet<Integer> fragmentInsns, final Instruction[] flow, TIntObjectHashMap<TIntHashSet> dfaResult, final int[] postorder) {
final LinkedHashSet<Integer> result = new LinkedHashSet<Integer>();
for (Instruction insn : flow) {
if (insn instanceof ReadWriteVariableInstruction &&
!((ReadWriteVariableInstruction) insn).isWrite()) {
final int ref = insn.num();
TIntHashSet defs = dfaResult.get(ref);
defs.forEach(new TIntProcedure() {
public boolean execute(int def) {
if (fragmentInsns.contains(def)) {
if (!fragmentInsns.contains(ref) || postorder[ref] < postorder[def]) {
result.add(ref);
return false;
}
}
return true;
}
});
}
}
return result;
}
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:24,代码来源:ReachingDefinitionsCollector.java
示例2: save
import gnu.trove.TIntProcedure; //导入依赖的package包/类
public static <X> void save(final TIntHashSet x, final DataOutput out) {
try {
DataInputOutputUtil.writeINT(out, x.size());
x.forEach(new TIntProcedure() {
@Override
public boolean execute(int value) {
try {
DataInputOutputUtil.writeINT(out, value);
return true;
}
catch (IOException e) {
throw new BuildDataCorruptedException(e);
}
}
});
}
catch (IOException c) {
throw new BuildDataCorruptedException(c);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:RW.java
示例3: save
import gnu.trove.TIntProcedure; //导入依赖的package包/类
@Override
public void save(@NotNull final DataOutput out, final TIntHashSet value) throws IOException {
final Ref<IOException> exRef = new Ref<IOException>(null);
value.forEach(new TIntProcedure() {
@Override
public boolean execute(int elem) {
try {
DataInputOutputUtil.writeINT(out, elem);
}
catch (IOException e) {
exRef.set(e);
return false;
}
return true;
}
});
final IOException exception = exRef.get();
if (exception != null) {
throw exception;
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:IntIntPersistentMultiMaplet.java
示例4: removeAll
import gnu.trove.TIntProcedure; //导入依赖的package包/类
@Override
public void removeAll(int key, TIntHashSet values) {
final TIntHashSet collection = myMap.get(key);
if (collection != null) {
values.forEach(new TIntProcedure() {
@Override
public boolean execute(int value) {
collection.remove(value);
return true;
}
});
if (collection.isEmpty()) {
myMap.remove(key);
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:IntIntTransientMultiMaplet.java
示例5: calcInLoop
import gnu.trove.TIntProcedure; //导入依赖的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
示例6: buildChunks
import gnu.trove.TIntProcedure; //导入依赖的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
示例7: IntroduceParameterSettingsUI
import gnu.trove.TIntProcedure; //导入依赖的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
示例8: removeParametersFromCall
import gnu.trove.TIntProcedure; //导入依赖的package包/类
private static void removeParametersFromCall(@NotNull final PsiExpressionList argList, TIntArrayList parametersToRemove) {
final PsiExpression[] exprs = argList.getExpressions();
parametersToRemove.forEachDescending(new TIntProcedure() {
public boolean execute(final int paramNum) {
try {
if (paramNum < exprs.length) {
exprs[paramNum].delete();
}
}
catch (IncorrectOperationException e) {
LOG.error(e);
}
return true;
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:JavaIntroduceParameterMethodUsagesProcessor.java
示例9: findConflicts
import gnu.trove.TIntProcedure; //导入依赖的package包/类
public void findConflicts(IntroduceParameterData data, UsageInfo[] usages, final MultiMap<PsiElement, String> conflicts) {
final PsiMethod method = data.getMethodToReplaceIn();
final int parametersCount = method.getParameterList().getParametersCount();
for (UsageInfo usage : usages) {
if (!isMethodUsage(usage)) continue;
final PsiElement element = usage.getElement();
final PsiCall call = RefactoringUtil.getCallExpressionByMethodReference(element);
final PsiExpressionList argList = call.getArgumentList();
if (argList != null) {
final int actualParamLength = argList.getExpressions().length;
if ((method.isVarArgs() && actualParamLength + 1 < parametersCount) ||
(!method.isVarArgs() && actualParamLength < parametersCount)) {
conflicts.putValue(call, "Incomplete call(" + call.getText() +"): " + parametersCount + " parameters expected but only " + actualParamLength + " found");
}
data.getParametersToRemove().forEach(new TIntProcedure() {
public boolean execute(int paramNum) {
if (paramNum >= actualParamLength) {
conflicts.putValue(call, "Incomplete call(" + call.getText() +"): expected to delete the " + paramNum + " parameter but only " + actualParamLength + " parameters found");
}
return true;
}
});
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:JavaIntroduceParameterMethodUsagesProcessor.java
示例10: processTextOccurrences
import gnu.trove.TIntProcedure; //导入依赖的package包/类
public static boolean processTextOccurrences(@NotNull CharSequence text,
int startOffset,
int endOffset,
@NotNull StringSearcher searcher,
@Nullable ProgressIndicator progress,
@NotNull TIntProcedure processor) {
if (endOffset > text.length()) {
throw new AssertionError("end>length");
}
for (int index = startOffset; index < endOffset; index++) {
if (progress != null) progress.checkCanceled();
//noinspection AssignmentToForLoopParameter
index = searcher.scan(text, index, endOffset);
if (index < 0) break;
if (checkJavaIdentifier(text, startOffset, endOffset, searcher, index)) {
if (!processor.execute(index)) return false;
}
}
return true;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:LowLevelSearchUtil.java
示例11: testTrailingSoftWrapOffsetShiftOnTyping
import gnu.trove.TIntProcedure; //导入依赖的package包/类
public void testTrailingSoftWrapOffsetShiftOnTyping() throws IOException {
// The main idea is to type on a logical line before soft wrap in order to ensure that its offset is correctly shifted back.
String text =
"line1<caret>\n" +
"second line that is long enough to be soft wrapped";
init(15, text);
TIntHashSet offsetsBefore = collectSoftWrapStartOffsets(1);
assertTrue(!offsetsBefore.isEmpty());
type('2');
final TIntHashSet offsetsAfter = collectSoftWrapStartOffsets(1);
assertSame(offsetsBefore.size(), offsetsAfter.size());
offsetsBefore.forEach(new TIntProcedure() {
@Override
public boolean execute(int value) {
assertTrue(offsetsAfter.contains(value + 1));
return true;
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:SoftWrapApplianceOnDocumentModificationTest.java
示例12: removeParametersFromCall
import gnu.trove.TIntProcedure; //导入依赖的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
示例13: removeParametersFromCall
import gnu.trove.TIntProcedure; //导入依赖的package包/类
private static void removeParametersFromCall(GrMethodCallExpression methodCall, GrIntroduceParameterSettings settings) {
final GroovyResolveResult resolveResult = methodCall.advancedResolve();
final PsiElement resolved = resolveResult.getElement();
LOG.assertTrue(resolved instanceof PsiMethod);
final GrClosureSignature signature = GrClosureSignatureUtil.createSignature((PsiMethod)resolved, resolveResult.getSubstitutor());
final GrClosureSignatureUtil.ArgInfo<PsiElement>[] argInfos = GrClosureSignatureUtil.mapParametersToArguments(signature, methodCall);
LOG.assertTrue(argInfos != null);
settings.parametersToRemove().forEach(new TIntProcedure() {
@Override
public boolean execute(int value) {
final List<PsiElement> args = argInfos[value].args;
for (PsiElement arg : args) {
arg.delete();
}
return true;
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:GrIntroduceClosureParameterProcessor.java
示例14: removeParametersFromCall
import gnu.trove.TIntProcedure; //导入依赖的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
示例15: save
import gnu.trove.TIntProcedure; //导入依赖的package包/类
public static <X> void save(final TIntHashSet x, final DataOutput out) {
try {
out.writeInt(x.size());
x.forEach(new TIntProcedure() {
@Override
public boolean execute(int value) {
try {
out.writeInt(value);
return true;
}
catch (IOException e) {
throw new RuntimeException(e);
}
}
});
}
catch (IOException c) {
throw new RuntimeException(c);
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:RW.java
示例16: save
import gnu.trove.TIntProcedure; //导入依赖的package包/类
@Override
public void save(final DataOutput out, final TIntHashSet value) throws IOException {
final Ref<IOException> exRef = new Ref<IOException>(null);
value.forEach(new TIntProcedure() {
@Override
public boolean execute(int elem) {
try {
out.writeInt(elem);
}
catch (IOException e) {
exRef.set(e);
return false;
}
return true;
}
});
final IOException exception = exRef.get();
if (exception != null) {
throw exception;
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:IntIntPersistentMultiMaplet.java
示例17: getIndexer
import gnu.trove.TIntProcedure; //导入依赖的package包/类
@NotNull
@Override
public DataIndexer<Integer, Void, FileContent> getIndexer() {
return new DataIndexer<Integer, Void, FileContent>() {
@Override
@NotNull
public Map<Integer, Void> map(FileContent inputData) {
final Map<Integer, Void> result = new THashMap<Integer, Void>();
TIntHashSet built = TrigramBuilder.buildTrigram(inputData.getContentAsText());
built.forEach(new TIntProcedure() {
@Override
public boolean execute(int value) {
result.put(value, null);
return true;
}
});
return result;
}
};
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:TrigramIndex.java
示例18: removeParametersFromCall
import gnu.trove.TIntProcedure; //导入依赖的package包/类
private static void removeParametersFromCall(final GrClosureSignatureUtil.ArgInfo<PsiElement>[] actualArgs,final TIntArrayList parametersToRemove) {
parametersToRemove.forEach(new TIntProcedure() {
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:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:GroovyIntroduceParameterMethodUsagesProcessor.java
示例19: removeParametersFromCall
import gnu.trove.TIntProcedure; //导入依赖的package包/类
public static void removeParametersFromCall(final GrClosureSignatureUtil.ArgInfo<PsiElement>[] actualArgs, final TIntArrayList parametersToRemove) {
parametersToRemove.forEach(new TIntProcedure() {
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:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:GroovyIntroduceParameterUtil.java
示例20: getMemberValues
import gnu.trove.TIntProcedure; //导入依赖的package包/类
List<DfaValue> getMemberValues() {
final List<DfaValue> result = new ArrayList<DfaValue>(size());
forEach(new TIntProcedure() {
@Override
public boolean execute(int c1) {
DfaValue value = myFactory.getValue(c1);
result.add(value);
return true;
}
});
return result;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:EqClass.java
注:本文中的gnu.trove.TIntProcedure类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论