Google Web Toolkit (Beta)
Search this site:

# Interface CharacterData

public interface CharacterData
extends Node
// Extended by `Text`, `Comment`
This interface describes `CharacterData` XML nodes. These can be either `Text`, `CDATASection` or `Comment` nodes.

## Methods

appendData(String) | This method appends `data` to the data in this `CharacterData`.
deleteData(int, int) | This method deletes data, starting at `offset`, and deleting `count` characters.
getData() | This method retrieves the data.
getLength() | This method retrieves the length of the data.
insertData(int, String) | This method inserts data at the specified offset.
replaceData(int, int, String) | This method replaces the substring of data indicated by `offset` and `count` with `replacementData`.
setData(String) | This method sets the data to `data`.
substringData(int, int) | This method gets a substring of the character data.

## Method Detail

### appendData

public void appendData(String appendedData)
This method appends `data` to the data in this `CharacterData`.

#### Parameters

appendedData
  the data to be appended to the end

### deleteData

public void deleteData(int offset, int count)
This method deletes data, starting at `offset`, and deleting `count` characters.

#### Parameters

offset
  how far from the beginning to start deleting
count
  how many characters to delete

### getData

public String getData()
This method retrieves the data.

#### Return Value

the data of this `CharacterData`

### getLength

public int getLength()
This method retrieves the length of the data.

#### Return Value

the length of the data contained in this `CharacterData`

### insertData

public void insertData(int offset, String insertedData)
This method inserts data at the specified offset.

#### Parameters

offset
  how far from the beginning to start inserting
insertedData
  the data to be inserted

### replaceData

public void replaceData(int offset, int count, String replacementData)
This method replaces the substring of data indicated by `offset` and `count` with `replacementData`.

#### Parameters

offset
  how far from the beginning to start the replacement
count
  how many characters to delete before inserting `replacementData`
replacementData
  the data that will replace the deleted data

### setData

public void setData(String data)
This method sets the data to `data`.

#### Parameters

data
  the new data

### substringData

public String substringData(int offset, int count)
This method gets a substring of the character data.

#### Parameters

offset
  the place to start the substring
count
  how many characters to return

#### Return Value

the specified substring