Examples of Error


Examples of jjil.core.Error

        STATE_FLOAT state = STATE_FLOAT.BEGIN;
        // read the float character by character
        int nChar = isr.read();
        do {
            if (nChar == -1) {
                throw new Error(
                                Error.PACKAGE.ALGORITHM,
                                ErrorCodes.INPUT_TERMINATED_EARLY,
                                isr.toString(),
                                null,
                                null);
            }
            char c = (char) nChar;
            /**
             * Parse float using FSM
             * BEGIN -> DIGITS_BEFORE_DECIMAL
             * DIGITS_BEFORE_DECIMAL -> DIGITS_BEFORE_DECIMAL ||
             *                          DIGITS_AFTER_DECIMAL ||
             *                          EXPONENT_BEGIN
             * DIGITS_AFTER_DECIMAL -> DIGITS_AFTER_DECIMAL ||
             *                         EXPONENT_BEGIN
             * EXPONENT_BEGIN -> EXPONENT
             */
            switch (state) {
                case BEGIN:
                    if (c == '+' || c == '-' || Character.isDigit(c)) {
                        szFloat += c;
                        state = STATE_FLOAT.DIGITS_BEFORE_DECIMAL;
                        nChar = isr.read();
                    } else {
                        // illegal empty string
                        throw new Error(
                                        Error.PACKAGE.ALGORITHM,
                                        ErrorCodes.PARSE_ERROR,
                                        isr.toString(),
                                        null,
                                        null);
View Full Code Here

Examples of jjil.core.Error

        String szToken = ""; //$NON-NLS-1$
        char c;
        do {
            int nCh = isr.read();
            if (nCh == -1) {
                throw new Error(
                                Error.PACKAGE.ALGORITHM,
                                ErrorCodes.INPUT_TERMINATED_EARLY,
                                isr.toString(),
                                null,
                                null);
            }
            c = (char) nCh;
            szToken += c;
        } while (c != ' ');
        if (szToken.compareTo("(hcsb ") == 0) return new HaarClassifierStumpBase(isr); //$NON-NLS-1$
        else
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            ErrorCodes.PARSE_ERROR,
                            szToken,
                            "(hcsb ",
                            isr.toString());
View Full Code Here

Examples of jjil.core.Error

        {

            char[] rC = new char[4];
            isr.read(rC, 0, 4);
            if ("(hr ".compareTo(new String(rC)) != 0) { //$NON-NLS-1$
                throw new Error(
                                Error.PACKAGE.ALGORITHM,
                                ErrorCodes.PARSE_ERROR,
                                new String(rC),
                                "(hr ",
                                isr.toString());
View Full Code Here

Examples of jjil.core.Error

           throws jjil.core.Error, IOException
        {
            char[] rC = new char[4];
            isr.read(rC, 0, 4);
            if ("(hf ".compareTo(new String(rC)) != 0) { //$NON-NLS-1$
                throw new Error(
                                Error.PACKAGE.ALGORITHM,
                                ErrorCodes.PARSE_ERROR,
                                new String(rC),
                                "(hf ",
                                isr.toString());
View Full Code Here

Examples of jjil.core.Error

    private HaarClassifierTreeBase parent;

    @Override
  public boolean eval(Image image) throws jjil.core.Error {
        if (!(image instanceof Gray32Image)) {
             throw new Error(
                    Error.PACKAGE.ALGORITHM,
                    ErrorCodes.IMAGE_NOT_GRAY32IMAGE,
                    image.toString(),
                    null,
                    null);
View Full Code Here

Examples of jjil.core.Error

      
        @Override
    public boolean eval(Image image) throws jjil.core.Error {
            if (!(image instanceof Gray8Image)) {
                 throw new Error(
                                 Error.PACKAGE.ALGORITHM,
                                 ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                                 image.toString(),
                                 null,
                                 null);
View Full Code Here

Examples of jjil.core.Error

        for (int i=0; i<n; i++) {
            this.hsc[i] = new HaarClassifierStump(isr, this.width, this.height);
        }
        n = isr.read();
        if (n == -1) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            ErrorCodes.INPUT_TERMINATED_EARLY,
                            isr.toString(),
                            null,
                            null);
        }
        char c = (char) n;
        if (c != ')') {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            ErrorCodes.PARSE_ERROR,
                            new Character(c).toString(),
                            ")",
                            isr.toString());
View Full Code Here

Examples of jjil.core.Error

            this.rSortedLabels = new Label[getComponentCount()];
            this.nSortedLabels = -1;
        }
        // see if the requested component is out of bounds
        if (nComponent >= this.rSortedLabels.length) {
            throw new Error(
                    Error.PACKAGE.ALGORITHM,
                    ErrorCodes.CONN_COMP_LABEL_OUT_OF_BOUNDS,
                    new Integer(nComponent).toString(),
                    this.rSortedLabels.toString(),
                    null);
View Full Code Here

Examples of jjil.core.Error

     * @throws jjil.core.Error if no components were found in the input image
     */
    public Image getFront() throws Error {
        if (this.getComponentCount() == 0 ||
                this.imLabeled == null) {
            throw new Error(
                    Error.PACKAGE.CORE,
                    jjil.core.ErrorCodes.NO_RESULT_AVAILABLE,
                    null,
                    null,
                    null);
View Full Code Here

Examples of jjil.core.Error

     * @throws jjil.core.Error
     *             if the image is not a gray 8-bit image.
     */
    public void push(Image image) throws jjil.core.Error {
        if (!(image instanceof Gray8Image)) {
            throw new Error(
                    Error.PACKAGE.ALGORITHM,
                    ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                    image.toString(),
                    null,
                    null);
View Full Code Here
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.