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

com.yahoo.vespa.indexinglanguage.expressions.CompositeExpression Maven / Gradle / Ivy

There is a newer version: 8.441.21
Show newest version
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.indexinglanguage.expressions;

import com.yahoo.document.DataType;
import com.yahoo.vespa.indexinglanguage.ExpressionConverter;

/**
 * @author Simon Thoresen Hult
 */
public abstract class CompositeExpression extends Expression {

    @Override
    public abstract CompositeExpression convertChildren(ExpressionConverter converter);

    protected CompositeExpression(DataType inputType) {
        super(inputType);
    }

    protected static String toScriptBlock(Expression exp) {
        if (exp instanceof ScriptExpression) {
            return exp.toString();
        }
        if (exp instanceof StatementExpression) {
            return new ScriptExpression((StatementExpression)exp).toString();
        }
        return new ScriptExpression(new StatementExpression(exp)).toString();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy