All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.vmzakharov.ecdataframe.dsl.FunctionScript Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package io.github.vmzakharov.ecdataframe.dsl;

import io.github.vmzakharov.ecdataframe.dsl.value.Value;
import io.github.vmzakharov.ecdataframe.dsl.visitor.ExpressionEvaluationVisitor;
import io.github.vmzakharov.ecdataframe.dsl.visitor.ExpressionVisitor;
import org.eclipse.collections.api.list.ListIterable;

public class FunctionScript
extends AbstractScript
implements FunctionDescriptor
{
    private final String name;
    private final String normalizedName;

    private final ListIterable parameterNames;

    public FunctionScript(String newName, ListIterable newParameterNames)
    {
        this.name = newName;
        this.normalizedName = this.name.toUpperCase();
        this.parameterNames = newParameterNames;
    }

    @Override
    public String getName()
    {
        return this.name;
    }

    public String getNormalizedName()
    {
        return this.normalizedName;
    }

    @Override
    public void accept(ExpressionVisitor visitor)
    {
        visitor.visitFunctionScriptExpr(this);
    }

    @Override
    public Value evaluate(ExpressionEvaluationVisitor evaluationVisitor)
    {
        return evaluationVisitor.visitFunctionScriptExpr(this);
    }

    @Override
    public ListIterable getParameterNames()
    {
        return this.parameterNames;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy