Package javolution.text

Examples of javolution.text.CharArray.array()


    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

        final int index = _namespacesCount[_nesting];
        _prefixesWritten[index] = isWritten;
        final int prefixLength = prefix.length();
        CharArray prefixTmp = _prefixesTmp[index];
        if ((prefixTmp == null)
                || (prefixTmp.array().length < prefixLength)) {
            MemoryArea.getMemoryArea(this).executeInArea(new Runnable() {
                public void run() {
                    _prefixesTmp[index] = new CharArray().setArray(new char[prefixLength + 32], 0, 0);
                }
            });
View Full Code Here

                }
            });
            prefixTmp = _prefixesTmp[index];
        }
        for (int i = 0; i < prefixLength; i++) {
            prefixTmp.array()[i] = prefix.charAt(i);
        }
        prefixTmp.setArray(prefixTmp.array(), 0, prefixLength);

        final int uriLength = uri.length();
        CharArray namespaceTmp = _namespacesTmp[index];
View Full Code Here

            prefixTmp = _prefixesTmp[index];
        }
        for (int i = 0; i < prefixLength; i++) {
            prefixTmp.array()[i] = prefix.charAt(i);
        }
        prefixTmp.setArray(prefixTmp.array(), 0, prefixLength);

        final int uriLength = uri.length();
        CharArray namespaceTmp = _namespacesTmp[index];
        if ((namespaceTmp == null)
                || (namespaceTmp.array().length < uriLength)) {
View Full Code Here

        prefixTmp.setArray(prefixTmp.array(), 0, prefixLength);

        final int uriLength = uri.length();
        CharArray namespaceTmp = _namespacesTmp[index];
        if ((namespaceTmp == null)
                || (namespaceTmp.array().length < uriLength)) {
            MemoryArea.getMemoryArea(this).executeInArea(new Runnable() {
                public void run() {
                    _namespacesTmp[index] = new CharArray().setArray(new char[uriLength + 32], 0, 0);
                }
            });
View Full Code Here

                }
            });
            namespaceTmp = _namespacesTmp[index];
        }
        for (int i = 0; i < uriLength; i++) {
            namespaceTmp.array()[i] = uri.charAt(i);
        }
        namespaceTmp.setArray(namespaceTmp.array(), 0, uriLength);
       
        // Sets the prefix using CharArray instances.
        setPrefix(prefixTmp, namespaceTmp);
View Full Code Here

            namespaceTmp = _namespacesTmp[index];
        }
        for (int i = 0; i < uriLength; i++) {
            namespaceTmp.array()[i] = uri.charAt(i);
        }
        namespaceTmp.setArray(namespaceTmp.array(), 0, uriLength);
       
        // Sets the prefix using CharArray instances.
        setPrefix(prefixTmp, namespaceTmp);
    }
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

            boolean isWritten) {
        final int index = _namespacesCount[_nesting];
        _prefixesWritten[index] = isWritten;
        final int prefixLength = prefix.length();
        CharArray prefixTmp = _prefixesTmp[index];
        if ((prefixTmp == null) || (prefixTmp.array().length < prefixLength)) {
            _prefixesTmp[index] = new CharArray().setArray(
                    new char[prefixLength + 32], 0, 0);
            prefixTmp = _prefixesTmp[index];
        }
        for (int i = 0; i < prefixLength; i++) {
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.