Package javolution.text

Examples of javolution.text.CharArray.offset()


                return _eventType = END_ELEMENT;
            }
        } else if (_eventType == END_ELEMENT) {
            _namespaces.pop();
            CharArray startElem = _elemStack[_depth--];
            _start = _index = startElem.offset();
            while (_seqs[--_seqsIndex] != startElem) { // Recycles CharArray instances.
            }
        }
        // Reader loop.
        while (true) {
View Full Code Here


        while (eventType != XMLStreamConstants.END_ELEMENT) {
            if (eventType == XMLStreamConstants.CHARACTERS) {
                if (text == null) {
                    text = getText();
                } else { // Merge (adjacent text, comments and PI are not kept).
                    text.setArray(_data, text.offset(), text.length()
                            + getText().length());
                }
            } else if (eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
                    || eventType == XMLStreamConstants.COMMENT) {
                // Skips (not kept).
View Full Code Here

    public int getTextCharacters(int sourceStart, char[] target,
            int targetStart, int length) throws XMLStreamException {
        CharArray text = getText();
        int copyLength = Math.min(length, text.length());
        System.arraycopy(text.array(), sourceStart + text.offset(), target,
                targetStart, copyLength);
        return copyLength;
    }

    public int getTextLength() {
View Full Code Here

            TextBuilder tb = (TextBuilder) csq;
            tb.getChars(_index, _index + count, cbuf, off);
        } else if (csq instanceof CharArray) {
            CharArray ca = (CharArray) csq;
            System
                    .arraycopy(ca.array(), _index + ca.offset(), cbuf, off,
                            count);
        } else { // Generic CharSequence.
            for (int i = off, n = off + count, j = _index; i < n;) {
                cbuf[i++] = _input.charAt(j++);
            }
View Full Code Here

        } else if (csq instanceof TextBuilder) {
            TextBuilder tb = (TextBuilder) csq;
            tb.getChars(index, index + count, cbuf, off);
        } else if (csq instanceof CharArray) {
            CharArray ca = (CharArray) csq;
            System.arraycopy(ca.array(), index + ca.offset(), cbuf, off, count);
        } else { // Generic CharSequence.
            for (int i = off, n = off + count, j = index; i < n;) {
                cbuf[i++] = input.charAt(j++);
            }
        }
View Full Code Here

                return _eventType = END_ELEMENT;
            }
        } else if (_eventType == END_ELEMENT) {
            _namespaces.pop();
            CharArray startElem = _elemStack[_depth--];
            _start = _index = startElem.offset();
            while (_seqs[--_seqsIndex] != startElem) { // Recycles CharArray instances.
            }
        }
        // Reader loop.
        while (true) {
View Full Code Here

        while (eventType != XMLStreamConstants.END_ELEMENT) {
            if (eventType == XMLStreamConstants.CHARACTERS) {
                if (text == null) {
                    text = getText();
                } else { // Merge (adjacent text, comments and PI are not kept).
                    text.setArray(_data, text.offset(), text.length()
                            + getText().length());
                }
            } else if (eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
                    || eventType == XMLStreamConstants.COMMENT) {
                // Skips (not kept).
View Full Code Here

    public int getTextCharacters(int sourceStart, char[] target,
            int targetStart, int length) throws XMLStreamException {
        CharArray text = getText();
        int copyLength = Math.min(length, text.length());
        System.arraycopy(text.array(), sourceStart + text.offset(), target,
                targetStart, copyLength);
        return copyLength;
    }

    public int getTextLength() {
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.