Package reportgen.utils

Examples of reportgen.utils.ReportException


        for(MathFunctionType func: getMathFunctions()) {
            if(func.getMnemonic().equals(mnemonic)) {
                return func;
            }
        }
        throw new ReportException("Функция  с идентификатором '" + mnemonic + "' не существует");
    }
View Full Code Here


        for(MOperator operator: getOperators()) {
            if(operator.getMnemonic().trim().equals(mnemonic)) {
                return operator;
            }
        }
        throw new ReportException("Оператор  с идентификатором '" + mnemonic + "' не существует");
    }
View Full Code Here

        for(ColRowRange range: getRanges()) {
            if(range.getAtom().equals(atom)) {
                return range;
            }
        }
        throw new ReportException("Диапазон с идентификатором '" + atom + "' не существует");

    }
View Full Code Here

    }


    public void appendRow(ResultsRow rr) throws ReportException {
        if(commited) {
            throw new ReportException("Results already commited");
        }

        if(groupByCols.size() == 0) {
            resultRows.add(rr);
        } else {
View Full Code Here

     */
    private static List<ResultsRow> cropToRowCount(List<ResultsRow> rows, RowCount rowCount)
            throws ReportException {

        if(rowCount.getMinimum() > rows.size()) {
            throw new ReportException("Запрос возвратил " + rows.size()
                    + " строк, а должен был как минимум" + rowCount.getMinimum());
        }
        List<ResultsRow> resRows = rows;
        if(rowCount.getMaximum() < rows.size()) {
            resRows = new LinkedList<ResultsRow>();
View Full Code Here

    private int cols;

    public QueryResults(int cols, List<ResultsRow> resultRows) throws ReportException {
        if(resultRows.size() > 0
                && resultRows.get(0).getWidth() != cols) {
            throw new ReportException("Результат отчета не соответствует отчету.");
        }
        rows = resultRows;
        this.cols = cols;
    }
View Full Code Here

        this.cols = cols;
    }

    public QueryResults(Element element) throws ReportException {
        if(!element.getName().equals(TAG)) {
            throw new ReportException("Обнаружен некорректный элемент");
        }
        cols = SupportXMLRootImpl.getIntAttribute(element, ATTR_COLS);
        if(cols == 0) {
            throw new ReportException("Атрибут "  + ATTR_COLS + " имеет некорректное значение: " + cols);
        }

        rows = new ArrayList<ResultsRow>();
        List children = element.getChildren(ResultsRow.ROWTAG);
        for(Object child : children) {
            ResultsRow row = new ResultsRow((Element) child);
            if(row.getWidth() != cols) {
                throw new ReportException("Обнаружен некорректный элемент ResultsRow");
            }
            rows.add(row);
        }
    }
View Full Code Here

               
                } else if (value instanceof Double) {
                    //fit, do nothing
               
                } else {
                    throw new ReportException("Невозможно инициализировать группу при рассчете среднего значения для класса "
                            + value.getClass().getSimpleName());
                }
                normalizeScaler.put(i, 1);

            } else if(clearAsis
View Full Code Here

                if(value instanceof Long) {
                    dval = new Double(((Long) value).doubleValue());
                } else if(value instanceof Double) {
                    dval = (Double) value;
                } else {
                    throw new ReportException("Невозможно рассчитать среднее значение для класса "
                            + value.getClass().getSimpleName());
                }
                values[i] = (Double) sum(values[i], dval);

                //update scaler
View Full Code Here

        return true;
    }

    private Object sum(Object value1, Object value2) throws ReportException {
        if(value1.getClass() != value2.getClass()) {
            throw new ReportException("Внутренняя ошибка, типы данных в разных строках результатов не совпадают");
        }
        Class cls = value1.getClass();
        if(cls.equals(Double.class)) {
            Double val = (Double)value1 + (Double)value2;
            return val;

        } else if(cls.equals(Long.class)) {
            Long val = (Long)value1 + (Long)value2;
            return val;

        } else {
            throw new ReportException("Внутренняя ошибка, неизвестный тип данных результах отчетов: " + cls.getSimpleName());               
        }          
    }
View Full Code Here

TOP

Related Classes of reportgen.utils.ReportException

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.