本文整理汇总了Java中gnu.mapping.Procedure.maxArgs方法的典型用法代码示例。如果您正苦于以下问题:Java Procedure.maxArgs方法的具体用法?Java Procedure.maxArgs怎么用?Java Procedure.maxArgs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.mapping.Procedure
的用法示例。
在下文中一共展示了Procedure.maxArgs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateApply
import gnu.mapping.Procedure; //导入方法依赖的package包/类
public Expression validateApply(ApplyExp exp, InlineCalls visitor,
Type required, Declaration decl) {
Expression[] initial = this.getArgs();
Expression[] xargs = exp.getArgs();
int nargs = initial.length + xargs.length;
int num = actual.numArgs();
int min = Procedure.minArgs(num);
int max = Procedure.maxArgs(num);
if (nargs < min || (max >= 0 && nargs > max)) {
// Future: optionally allow re-curry if nargs < min?
return super.validateApply(exp, visitor, required, decl);
}
Expression[] targs = new Expression[nargs];
System.arraycopy(initial, 0, targs, 0, initial.length);
System.arraycopy(xargs, 0, targs, initial.length, xargs.length);
return visitor.visit(new ApplyExp(actual, targs), required);
}
示例2: callMethod
import gnu.mapping.Procedure; //导入方法依赖的package包/类
private void callMethod(Symbol procedureName) throws Exception {
if (SchemeEnvironment.isDefined(context.getEnvironmentName(), procedureName.toString())) {
Procedure p = (Procedure) SchemeEnvironment.eval(context.getEnvironmentName(),
procedureName.toString());
if (p.maxArgs() == 2) {
SchemeEnvironment.applyProcedure(context.getEnvironmentName(),
procedureName.toString(),
context, latch);
} else {
SchemeEnvironment.applyProcedure(context.getEnvironmentName(),
procedureName.toString(),
context);
latch.countDown(context.getName());
log.debug("Latch countdowned={}, at task={}", latch, task);
}
} else {
if (ReflectionMethodInvoker.isDefined(context, procedureName.toString(), latch)) {
ReflectionMethodInvoker.invoke(context, procedureName.toString(), latch);
} else {
ReflectionMethodInvoker.invoke(context, procedureName.toString());
latch.countDown(context.getName());
log.debug("Latch countdowned={}, at task={}", latch, task);
}
}
}
示例3: callMethod
import gnu.mapping.Procedure; //导入方法依赖的package包/类
private void callMethod(Symbol procedureName, Player self) throws Exception {
if (SchemeEnvironment.isDefined(context.getEnvironmentName(), procedureName.toString())) {
Procedure p = (Procedure) SchemeEnvironment.eval(context.getEnvironmentName(),
procedureName.toString());
if (p.maxArgs() == 3) {
SchemeEnvironment.applyProcedure(context.getEnvironmentName(),
procedureName.toString(),
context, self, latch);
} else {
SchemeEnvironment.applyProcedure(context.getEnvironmentName(),
procedureName.toString(),
context, self);
latch.countDown(self.getName());
log.debug("Latch countdowned={}, at task={}", latch, task);
}
} else {
if (ReflectionMethodInvoker.isDefined(self, procedureName.toString(), context, latch)) {
ReflectionMethodInvoker.invoke(self, procedureName.toString(), context, latch);
} else {
ReflectionMethodInvoker.invoke(self, procedureName.toString(), context);
latch.countDown(self.getName());
log.debug("Latch countdowned={}, at task={}", latch, task);
}
}
}
示例4: callMethod
import gnu.mapping.Procedure; //导入方法依赖的package包/类
private void callMethod(Symbol procedureName, Player self, T msg) throws Exception {
if (SchemeEnvironment.isDefined(context.getEnvironmentName(), procedureName.toString())) {
Procedure p = (Procedure) SchemeEnvironment.eval(context.getEnvironmentName(),
procedureName.toString());
if (p.maxArgs() == 4) {
SchemeEnvironment.applyProcedure(context.getEnvironmentName(),
procedureName.toString(),
context, self, msg, latch);
} else {
SchemeEnvironment.applyProcedure(context.getEnvironmentName(),
procedureName.toString(),
context, self, msg);
latch.countDown(self.getName());
log.debug("Latch countdowned={}, at task={}", latch, task);
}
} else {
if (ReflectionMethodInvoker.isDefined(self, procedureName.toString(), context, msg,
latch)) {
ReflectionMethodInvoker.invoke(self, procedureName.toString(), context, msg, latch);
} else {
ReflectionMethodInvoker.invoke(self, procedureName.toString(), context, msg);
latch.countDown(self.getName());
log.debug("Latch countdowned={}, at task={}", latch, task);
}
}
}