org.snapscript.tree.closure.ClosureParameterList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snap Show documentation
Show all versions of snap Show documentation
Dynamic scripting for the JVM
package org.snapscript.tree.closure;
import java.util.List;
import org.snapscript.core.constraint.Constraint;
import org.snapscript.core.function.Signature;
import org.snapscript.core.scope.Scope;
import org.snapscript.tree.function.ParameterDeclaration;
import org.snapscript.tree.function.ParameterList;
public class ClosureParameterList {
private final ParameterList multiple;
private final ParameterList single;
public ClosureParameterList() {
this(null, null);
}
public ClosureParameterList(ParameterList multiple) {
this(multiple, null);
}
public ClosureParameterList(ParameterDeclaration single) {
this(null, single);
}
public ClosureParameterList(ParameterList multiple, ParameterDeclaration single) {
this.single = new ParameterList(single);
this.multiple = multiple;
}
public Signature create(Scope scope, List generics) throws Exception{
if(multiple != null) {
return multiple.create(scope, generics);
}
return single.create(scope, generics);
}
}