1 package org.simantics.scl.commands.internal.checker;
5 import org.simantics.scl.compiler.types.Type;
6 import org.simantics.scl.runtime.function.Function;
8 public class FunctionCheckItem implements CheckItem {
13 public FunctionCheckItem(Type parameterType, CheckItem next) {
14 this.parameterType = parameterType;
18 @SuppressWarnings({ "unchecked", "rawtypes" })
20 public boolean check(Object check, Object[] parameters, int pos) {
21 if(pos == parameters.length)
23 Object nextCheck = ((Function)check).apply(parameters[pos]);
24 return next.check(nextCheck, parameters, pos+1);
28 public void collectParameterTypes(List<Type> types) {
29 types.add(parameterType);
30 next.collectParameterTypes(types);