CharacterData

public interface CharacterData implements Node
Known Indirect Subclasses

The CharacterData interface extends Node with a set of attributes and methods for accessing character data in the DOM. For clarity this set is defined here rather than on each object that uses these attributes and methods. No DOM objects correspond directly to CharacterData, though Text and others do inherit the interface from it. All offsets in this interface start from 0.

As explained in the DOMString interface, text strings in the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In the following, the term 16-bit units is used whenever necessary to indicate that indexing on CharacterData is done in 16-bit units.

See also the Document Object Model (DOM) Level 3 Core Specification.

Inherited Constant Summary

Public Method Summary

abstract void
appendData(String arg)
Append the string to the end of the character data of the node.
abstract void
deleteData(int offset, int count)
Remove a range of 16-bit units from the node.
abstract String
getData()
The character data of the node that implements this interface.
abstract int
getLength()
The number of 16-bit units that are available through data and the substringData method below.
abstract void
insertData(int offset, String arg)
Insert a string at the specified 16-bit unit offset.
abstract void
replaceData(int offset, int count, String arg)
Replace the characters starting at the specified 16-bit unit offset with the specified string.
abstract void
setData(String data)
The character data of the node that implements this interface.
abstract String
substringData(int offset, int count)
Extracts a range of data from the node.

Inherited Method Summary