Package org.boris.expr.function.excel

Source Code of org.boris.expr.function.excel.CONCATENATE

package org.boris.expr.function.excel;

import org.boris.expr.Expr;
import org.boris.expr.ExprException;
import org.boris.expr.ExprNumber;
import org.boris.expr.ExprString;
import org.boris.expr.function.AbstractFunction;

public class CONCATENATE extends AbstractFunction
{
    public Expr evaluate(Expr[] args) throws ExprException {
        assertMinArgCount(args, 1);
        StringBuilder sb = new StringBuilder();
        for (Expr a : args) {
            a = evalArg(a);
            if (a instanceof ExprString) {
                sb.append(((ExprString) a).str);
            } else if (a instanceof ExprNumber) {
                sb.append(a.toString());
            }
        }
        return new ExprString(sb.toString());
    }
}
TOP

Related Classes of org.boris.expr.function.excel.CONCATENATE

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.