Package reportgen.math

Examples of reportgen.math.MathExpressionOperand


    public ResultsRow(Element element) throws ReportException {
        List children = element.getChildren();
        values = new Object[children.size()];
        for(int i = 0; i<children.size(); i++) {
            Element iElement = (Element) children.get(i);
            MathExpressionOperand express = (MathExpressionOperand)
                    MathFactory.fromXml(iElement, context, new ContextFilter() {
                @Override
                public Context getChildContext(ContextGroup group) {
                    return context;
                }
            });
            values[i] = express.getValue(null);
        }
    }
View Full Code Here


        } else if(exp instanceof MathExpressionComplex) {
            MathExpressionComplex cx = (MathExpressionComplex) exp;
            MathExpressionList list = cx.getChildren();
            for(int i=0; i<list.size(); i++) {
                if((list.get(i) instanceof MathExpressionOperand)) {
                    MathExpressionOperand operand = (MathExpressionOperand) list.get(i);
                    if(isContainProperty(operand, prop)) {
                        return true;
                    }
                }
            }
View Full Code Here

        mainPanel.add(me.getOperator().getPanel(parent), BorderLayout.NORTH);

        //берем операнд
        //если не пустой, берем у него панель
        MathExpressionOperand operand = me.getOperand();
        if(operand != null) {
            //панель останется как нулл
            mainPanel.add(operand.getPanel(parent), BorderLayout.CENTER);
        else {
            //иначе создаем панель
            operandPanel =  MathExpressionInlineRef.GROUP.getCreatePanel(parent,
                me.getChildContext(MathExpressionInlineRef.GROUP));
            mainPanel.add(operandPanel);
View Full Code Here

        this.me = exp;
        assert me != null;

        mainPanel.add(me.getOperator().getPanel(parent), BorderLayout.NORTH);

        MathExpressionOperand operand = me.getOperand();
        Context localContext = me.getLocalContext();
        //если операнд есть, он сам знает свою панель,
        //иначе придется перебирать режимы контекста и создавать панель, соотв режиму контекста
       
        if(operand != null) {
            //панель останется как нулл
            mainPanel.add(operand.getPanel(parent), BorderLayout.CENTER);

        } else
        {
            if(localContext.getContextMode() == ContextMode.STAGE_3_CONDITIONS) {
            operandPanel =  MathExpressionResultColumnRef.GROUP.getCreatePanel(parent,
View Full Code Here

     * @return
     * @throws reportgen.ren.exception.ReportException
     */
    static private Class getExpressionClass(Object express) throws ReportException {
        if(express instanceof MathExpressionOperand) {
            MathExpressionOperand operand = (MathExpressionOperand) express;
            return operand.getCls();
        } else if(express instanceof Class) {
            return (Class) express;
        }
        throw new ReportException("Ожидается операнд: " + express);
    }
View Full Code Here

     * @throws reportgen.ren.exception.ReportException
     */
    static private Object getExpressionValue(Object express, Map constants)
            throws ReportException {
        if(express instanceof MathExpressionOperand) {
            MathExpressionOperand operand = (MathExpressionOperand) express;
            return operand.getValue(constants);
        }
        return express;
    }
View Full Code Here

    public Object getValue(List<MathExpressionOperand> args, Map constants)
            throws ReportException {
        checkArgumentsCount(args.size());

        //condition
        MathExpressionOperand operand = args.get(0);
        Object conditionValue = operand.getValue(constants);
        if(!(conditionValue instanceof Boolean)) {
            throw new ReportException("Первый аргумент функции 'ЕСЛИ' должен быть булевого типа");
        }
       
        Boolean condition = (conditionValue == null) ? Boolean.FALSE : (Boolean) conditionValue;
        if(condition) {
            operand = args.get(1);
        } else {
            operand = args.get(2);
        }
        return operand.getValue(constants);
    }
View Full Code Here

            }
        }
       
        List<Class> operandClasses = new ArrayList<Class>();
        for(int i=0; i<children.size(); i++) {
            MathExpressionOperand operand = (MathExpressionOperand) children.get(i);
            operandClasses.add(operand != null ? operand.getCls() : null);
        }  
        return function.validate(operandClasses);
    }
View Full Code Here

        List<Class> operandClasses = new ArrayList<Class>();
        checkArgumentsCount(args.size());

        for(int i=0; i<args.size(); i++) {
            //dont check static cast, because of validation earlier
            MathExpressionOperand operand = args.get(i);

            Object arg = operand.getValue(constants);
            arguments.add(arg);
            operandClasses.add(arg != null ? arg.getClass() : null);
        }

        List<Class> cls = new ArrayList<Class>();
View Full Code Here

TOP

Related Classes of reportgen.math.MathExpressionOperand

Copyright © 2018 www.massapicom. 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.