org.snapscript.tree.define.GenericList 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.define;
import java.util.ArrayList;
import java.util.List;
import org.snapscript.core.constraint.Constraint;
import org.snapscript.core.scope.Scope;
public class GenericList {
private final GenericParameter[] declarations;
public GenericList(GenericParameter... declarations) {
this.declarations = declarations;
}
public List getGenerics(Scope scope) throws Exception {
List generics = new ArrayList();
if(declarations != null) {
for(GenericParameter declaration : declarations) {
Constraint constraint = declaration.getGeneric(scope);
generics.add(constraint);
}
}
return generics;
}
}