Package mondrian.olap

Examples of mondrian.olap.InvalidArgumentException


                    return DateFormat.getDateTimeInstance().parse(str);
                } catch (ParseException ex1) {
                    try {
                        return DateFormat.getDateInstance().parse(str);
                    } catch (ParseException ex2) {
                        throw new InvalidArgumentException(
                            "Invalid parameter. "
                            + "expression parameter of CDate function must be "
                            + "formatted correctly ("
                            + String.valueOf(expression) + ")");
                    }
View Full Code Here


            if (v < 0 && v < dv) {
                v++;
            }
            return v;
        } else {
            throw new InvalidArgumentException(
                "Invalid parameter. "
                + "number parameter " + number
                + " of Int function must be " + "of type number");
        }
    }
View Full Code Here

    public static String hex(Object number) {
        if (number instanceof Number) {
            return Integer.toHexString(((Number) number).intValue())
                    .toUpperCase();
        } else {
            throw new InvalidArgumentException(
                "Invalid parameter. "
                + "number parameter " + number
                + " of Hex function must be " + "of type number");
        }
    }
View Full Code Here

            if (v < 0 && v > dv) {
                v--;
            }
            return v;
        } else {
            throw new InvalidArgumentException(
                "Invalid parameter. "
                + "number parameter " + number
                + " of Int function must be " + "of type number");
        }
    }
View Full Code Here

        "Returns a Variant (String) representing the octal value of a number.")
    public static String oct(Object number) {
        if (number instanceof Number) {
            return Integer.toOctalString(((Number) number).intValue());
        } else {
            throw new InvalidArgumentException(
                "Invalid parameter. "
                + "number parameter " + number
                + " of Oct function must be " + "of type number");
        }
    }
View Full Code Here

                return " " + number.toString();
            } else {
                return number.toString();
            }
        } else {
            throw new InvalidArgumentException(
                "Invalid parameter. "
                + "number parameter " + number
                + " of Str function must be " + "of type number");
        }
    }
View Full Code Here

        double fv, // the future value of the annuity ($ if savings)
        boolean due,
        double guess)
    {
        if (nPer <= 0) {
            throw new InvalidArgumentException(
                "number of payment periods must be larger than 0");
        }
        double minGuess = 0.0;
        double maxGuess = 1.0;
View Full Code Here

        String stringMatch,
        int compare /* default BinaryCompare */)
    {
        // todo: implement binary vs. text compare
        if (start == 0 || start < -1) {
            throw new InvalidArgumentException(
                    "start must be -1 or a location in the string to start");
        }
        if (start != -1) {
            return stringCheck.indexOf(stringMatch, start - 1) + 1;
        } else {
View Full Code Here

        int start /* default -1 */,
        int compare /* default BinaryCompare */)
    {
        // todo: implement binary vs. text compare
        if (start == 0 || start < -1) {
            throw new InvalidArgumentException(
                    "start must be -1 or a location in the string to start");
        }
        if (start != -1) {
            return stringCheck.lastIndexOf(stringMatch, start - 1) + 1;
        } else {
View Full Code Here

    @Description("Returns a specified number of characters from a string.")
    public static String mid(String value, int beginIndex, int length) {
        // Arguments are 1-based. Spec says that the function gives an error if
        // Start <= 0 or Length < 0.
        if (beginIndex <= 0) {
            throw new InvalidArgumentException(
                "Invalid parameter. "
                + "Start parameter of Mid function must be positive");
        }
        if (length < 0) {
            throw new InvalidArgumentException(
                "Invalid parameter. "
                + "Length parameter of Mid function must be non-negative");
        }

        if (beginIndex > value.length()) {
View Full Code Here

TOP

Related Classes of mondrian.olap.InvalidArgumentException

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.