⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 minml.java

📁 实现了一个基于j2me移动gps定位系统
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
    public void setDocumentHandler(final DocumentHandler handler) {
        this.documentHandler = this.extDocumentHandler = (handler == null) ? this
                : handler;
        this.documentHandler.setDocumentLocator(this);
    }

    /**
     * @param handler
     *            The errorHandler to set.
     * @uml.property name="errorHandler"
     */
    public void setErrorHandler(final ErrorHandler handler) {
        this.errorHandler = (handler == null) ? this : handler;
    }

    public void setDocumentLocator(final Locator locator) {
    }

    public void startDocument() throws SAXException {
    }

    public Writer startDocument(final Writer writer) throws SAXException {
        this.documentHandler.startDocument();
        return writer;
    }

    public void endDocument() throws SAXException {
    }

    public void startElement(final String name, final AttributeList attributes)
            throws SAXException {
    }

    public Writer startElement(final String name,
            final AttributeList attributes, final Writer writer)
            throws SAXException {
        this.documentHandler.startElement(name, attributes);
        return writer;
    }

    public void endElement(final String name) throws SAXException {
    }

    public void characters(final char ch[], final int start, final int length)
            throws SAXException {
    }

    public void ignorableWhitespace(final char ch[], final int start,
            final int length) throws SAXException {
    }

    public void processingInstruction(final String target, final String data)
            throws SAXException {
    }

    public void warning(final SAXParseException e) throws SAXException {
    }

    public void error(final SAXParseException e) throws SAXException {
    }

    public void fatalError(final SAXParseException e) throws SAXException {
        throw e;
    }

    public String getPublicId() {
        return "";
    }

    public String getSystemId() {
        return "";
    }

    /**
     * @return Returns the lineNumber.
     * @uml.property name="lineNumber"
     */
    public int getLineNumber() {
        return this.lineNumber;
    }

    /**
     * @return Returns the columnNumber.
     * @uml.property name="columnNumber"
     */
    public int getColumnNumber() {
        return this.columnNumber;
    }

    private void fatalError(final String msg, final int lineNumber,
            final int columnNumber) throws SAXException {
        this.errorHandler.fatalError(new SAXParseException(msg, null, null,
                lineNumber, columnNumber));
    }

    /**
     * @author khanhlnq
     */
    private class MinMLBuffer extends Writer {

        public MinMLBuffer(final Reader in) {
            this.in = in;
        }

        public void close() throws IOException {
            flush();
        }

        public void flush() throws IOException {
            try {
                _flush();
                if (writer != this)
                    writer.flush();
            } finally {
                flushed = true;
            }
        }

        public void write(final int c) throws IOException {
            written = true;
            chars[count++] = (char) c;
        }

        public void write(final char[] cbuf, final int off, final int len)
                throws IOException {
            written = true;
            System.arraycopy(cbuf, off, chars, count, len);
            count += len;
        }

        public void saveChar(final char c) {
            written = false;
            chars[count++] = c;
        }

        public void pushWriter(final Writer writer) {
            MinML.this.tags.push(this.writer);

            this.writer = (writer == null) ? this : writer;

            flushed = written = false;
        }

        /**
         * @return Returns the writer.
         * @uml.property name="writer"
         */
        public Writer getWriter() {
            return writer;
        }

        public void popWriter() throws IOException {
            try {
                if (!flushed && writer != this)
                    writer.flush();
            } finally {
                writer = (Writer) MinML.this.tags.pop();
                flushed = written = false;
            }
        }

        public String getString() {
            final String result = new String(chars, 0, count);

            count = 0;
            return result;
        }

        public void reset() {
            count = 0;
        }

        public int read() throws IOException {
            if (nextIn == lastIn) {
                if (count != 0) {
                    if (written) {
                        _flush();
                    } else if (count >= (chars.length - MinML.this.bufferIncrement)) {
                        final char[] newChars = new char[chars.length
                                + MinML.this.bufferIncrement];

                        System.arraycopy(chars, 0, newChars, 0, count);
                        chars = newChars;
                    }
                }

                final int numRead = in.read(chars, count, chars.length - count);

                if (numRead == -1)
                    return -1;

                nextIn = count;
                lastIn = count + numRead;
            }

            return chars[nextIn++];
        }

        private void _flush() throws IOException {
            if (count != 0) {
                try {
                    if (writer == this) {
                        try {
                            MinML.this.documentHandler.characters(chars, 0,
                                    count);
                        } catch (final SAXException e) {
                            throw new IOException(e.toString());
                        }
                    } else {
                        writer.write(chars, 0, count);
                    }
                } finally {
                    count = 0;
                }
            }
        }

        private int nextIn = 0;
        private int lastIn = 0;
        private char[] chars = new char[MinML.this.initialBufferSize];
        private final Reader in;
        private int count = 0;
        /**
         * @uml.property name="writer"
         */
        private Writer writer = this;
        private boolean flushed = false;
        private boolean written = false;
    }

    private DocumentHandler extDocumentHandler = this;
    private org.xml.sax.DocumentHandler documentHandler = this;
    private ErrorHandler errorHandler = this;
    private final Stack tags = new Stack();
    /**
     * @uml.property name="lineNumber"
     */
    private int lineNumber = 1;
    /**
     * @uml.property name="columnNumber"
     */
    private int columnNumber = 0;
    private final int initialBufferSize;
    private final int bufferIncrement;

    private static final byte[] charClasses = {
    // EOF
            13,
            // \t \n \r
            -1, -1, -1, -1, -1, -1, -1, -1, -1, 12, 12, -1, -1, 12, -1, -1,
            //
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
            // SP ! " # $ % & ' ( ) * + , - . /
            12, 8, 7, 14, 14, 14, 3, 6, 14, 14, 14, 14, 14, 11, 14, 2,
            // 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 5, 1, 4,
            //
            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
            // [ \ ]
            14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 9, 14, 10 };

    private static final String[] operands = {
            "\u0d15\u1611\u1611\u1611\u1611\u1611\u1611\u1611\u1611\u1611\u1611\u1611\u0015\u0010\u1611",
            "\u1711\u1000\u0b00\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u0114\u0200\u1811\u0114",
            "\u1711\u1001\u0b01\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u0215\u1811\u0414",
            "\u1711\u1001\u0b01\u1711\u1911\u1911\u1911\u1911\u1911\u1911\u1911\u1911\u0315\u1811\u0414",
            "\u1911\u1911\u1911\u1911\u1911\u0606\u1911\u1911\u1911\u1911\u1911\u0414\u0515\u1811\u0414",
            "\u1911\u1911\u1911\u1911\u1911\u0606\u1911\u1911\u1911\u1911\u1911\u1911\u0515\u1811\u1911",
            "\u1a11\u1a11\u1a11\u1a11\u1a11\u1a11\u0715\u0815\u1a11\u1a11\u1a11\u1a11\u0615\u1811\u1a11",
            "\u0714\u0714\u0714\u070e\u0714\u0714\u0307\u0714\u0714\u0714\u0714\u0714\u0714\u1811\u0714",
            "\u0814\u0814\u0814\u080e\u0814\u0814\u0814\u0307\u0814\u0814\u0814\u0814\u0814\u1811\u0814",
            "\u1711\u1002\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u0914\u0915\u1811\u0914",
            "\u1b11\u1b11\u0904\u1b11\u1b11\u1b11\u1b11\u1b11\u1215\u1b11\u1b11\u1b11\u1b11\u1811\u0105",
            "\u1711\u1012\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1711\u1811\u1711",
            "\u1711\u1c11\u0912\u1711\u0e12\u1711\u1711\u1711\u1212\u1711\u1711\u1711\u1711\u1811\u0113",
            "\u1711\u1c11\u0912\u1711\u0e12\u1711\u1711\u1711\u1212\u1711\u1711\u1711\u1711\u1811\u0113",
            "\u0e15\u0e15\u0e15\u0e15\u0f15\u0e15\u0e15\u0e15\u0e15\u0e15\u0e15\u0e15\u0e15\u1811\u0e15",
            "\u0e15\u0015\u0e15\u0e15\u0f15\u0e15\u0e15\u0e15\u0e15\u0e15\u0e15\u0e15\u0e15\u1811\u0e15",
            "\u0c03\u110f\u110f\u110e\u110f\u110f\u110f\u110f\u110f\u110f\u110f\u110f\u1014\u1811\u110f",
            "\u0a15\u110f\u110f\u110e\u110f\u110f\u110f\u110f\u110f\u110f\u110f\u110f\u110f\u1811\u110f",
            "\u1d11\u1d11\u1d11\u1d11\u1d11\u1d11\u1d11\u1d11\u1d11\u130c\u1d11\u1408\u1d11\u1811\u1515",
            "\u130f\u130f\u130f\u130f\u130f\u130f\u130f\u130f\u130f\u130f\u110d\u130f\u130f\u1811\u130f",
            "\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u0009\u1415\u1811\u1415",
            "\u150a\u000b\u1515\u1515\u1515\u1515\u1515\u1515\u1515\u1515\u1515\u1515\u1515\u1811\u1515",
            "expected Element", "unexpected character in tag",
            "unexpected end of file found",
            "attribute name not followed by '='", "invalid attribute value",
            "expecting end tag", "empty tag", "unexpected character after <!" };
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -