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


Java Procedure.maxArgs方法代码示例

本文整理汇总了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);
}
 
开发者ID:spurious,项目名称:kawa-mirror,代码行数:18,代码来源:CurryExp.java

示例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);
		}
	}

}
 
开发者ID:MAGCruise,项目名称:magcruise-core,代码行数:27,代码来源:ContextTask.java

示例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);
		}
	}
}
 
开发者ID:MAGCruise,项目名称:magcruise-core,代码行数:26,代码来源:PlayerTask.java

示例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);
		}
	}

}
 
开发者ID:MAGCruise,项目名称:magcruise-core,代码行数:28,代码来源:EventDrivenTask.java


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