FileDocCategorySizeDatePackage
CharacterDataImpl.javaAPI DocAndroid 1.5 API2897Wed May 06 22:41:06 BST 2009org.apache.harmony.xml.dom

CharacterDataImpl

public abstract class CharacterDataImpl extends LeafNodeImpl implements CharacterData
Provides a straightforward implementation of the corresponding W3C DOM interface. The class is used internally only, thus only notable members that are not in the original interface are documented (the W3C docs are quite extensive). Hope that's ok.

Some of the fields may have package visibility, so other classes belonging to the DOM implementation can easily access them while maintaining the DOM tree structure.

Fields Summary
private StringBuffer
buffer
Constructors Summary
CharacterDataImpl(DocumentImpl document, String data)

        super(document);
        setData(data);
    
Methods Summary
public voidappendData(java.lang.String arg)

        buffer.append(arg);
    
public voiddeleteData(int offset, int count)

        buffer.delete(offset, offset + count);
    
public java.lang.StringgetData()

        return buffer.toString();
    
public intgetLength()

        return buffer.length();
    
public java.lang.StringgetNodeValue()

        return getData();
    
public voidinsertData(int offset, java.lang.String arg)

        try {
            buffer.insert(offset, arg);
        } catch (ArrayIndexOutOfBoundsException ex) {
            throw new DOMException(DOMException.INDEX_SIZE_ERR, null);
        }
    
public voidreplaceData(int offset, int count, java.lang.String arg)

        try {
            buffer.replace(offset, offset + count, arg);
        } catch (ArrayIndexOutOfBoundsException ex) {
            throw new DOMException(DOMException.INDEX_SIZE_ERR, null);
        }
    
public voidsetData(java.lang.String data)

        buffer = new StringBuffer(data);
    
public java.lang.StringsubstringData(int offset, int count)

        try {
            return buffer.substring(offset, offset + count);
        } catch (ArrayIndexOutOfBoundsException ex) {
            throw new DOMException(DOMException.INDEX_SIZE_ERR, null);
        }