Package org.boris.expr.function.excel

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

package org.boris.expr.function.excel;

import org.boris.expr.Expr;
import org.boris.expr.ExprArray;
import org.boris.expr.ExprBoolean;
import org.boris.expr.ExprDouble;
import org.boris.expr.ExprException;
import org.boris.expr.ExprInteger;
import org.boris.expr.ExprString;
import org.boris.expr.function.AbstractFunction;

public class TYPE extends AbstractFunction
{
    public Expr evaluate(Expr[] args) throws ExprException {
        assertArgCount(args, 1);
        Expr a = evalArg(args[0]);
        if (a instanceof ExprString) {
            return new ExprDouble(2);
        } else if (a instanceof ExprInteger || a instanceof ExprDouble) {
            return new ExprDouble(1);
        } else if (a instanceof ExprBoolean) {
            return new ExprDouble(4);
        } else if (a instanceof ExprArray) {
            return new ExprDouble(64);
        } else {
            return new ExprDouble(16);
        }
    }
}
TOP

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

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.