com.gargoylesoftware.htmlunit.html
Class DomCharacterData

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.html.DomNode
      extended by com.gargoylesoftware.htmlunit.html.DomCharacterData
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
DomComment, DomText

public abstract class DomCharacterData
extends DomNode

Wrapper for the DOM node CharacterData.

Version:
$Revision: 1.3 $
Author:
David K. Taylor, Christian Sell
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.gargoylesoftware.htmlunit.html.DomNode
PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED
 
Constructor Summary
DomCharacterData(HtmlPage page, java.lang.String data)
 Create an instance of DomCharacterData
 
Method Summary
 void appendData(java.lang.String newData)
 Append a string to character data.
 void deleteData(int offset, int count)
 Delete characters from character data.
 java.lang.String getData()
 Get the data character string for this character data.
 int getLength()
 Get the number of characters in the character data.
 java.lang.String getNodeValue()
 Get the value for the current node.
 void insertData(int offset, java.lang.String arg)
 Insert a string into character data.
 void replaceData(int offset, int count, java.lang.String arg)
 Replace characters of character data with a string.
 void setData(java.lang.String newValue)
 Set the data character string to the new string.
 void setNodeValue(java.lang.String newValue)
 Set the data character string to the new string.
 java.lang.String substringData(int offset, int count)
 Extract a substring from character data.
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNode
addDomChangeListener, appendDomChild, asText, asXml, cloneDomNode, getAllHtmlChildElements, getByXPath, getChildIterator, getEndColumnNumber, getEndLineNumber, getEventHandler, getFirstDomChild, getLastDomChild, getNextDomSibling, getNodeName, getNodeType, getPage, getParentDomNode, getPreviousDomSibling, getReadyState, getScriptObject, getStartColumnNumber, getStartLineNumber, insertBefore, remove, removeAllChildren, removeDomChangeListener, removeEventHandler, replace, setEventHandler, setEventHandler, setReadyState, setScriptObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DomCharacterData

public DomCharacterData(HtmlPage page,
                        java.lang.String data)
Create an instance of DomCharacterData

Parameters:
page - The HtmlPage that contains this element.
data - the data string wrapped by this node
Method Detail

appendData

public void appendData(java.lang.String newData)
Append a string to character data.

Parameters:
newData - The string to be appended to the character data.

deleteData

public void deleteData(int offset,
                       int count)
Delete characters from character data.

Parameters:
offset - The position of the first character to be deleted.
count - The number of characters to be deleted.

getData

public java.lang.String getData()
Get the data character string for this character data.

Returns:
The data String.

getLength

public int getLength()
Get the number of characters in the character data.

Returns:
The number of characters.

getNodeValue

public java.lang.String getNodeValue()
Description copied from class: DomNode
Get the value for the current node.

Overrides:
getNodeValue in class DomNode
Returns:
the string data held by this node

insertData

public void insertData(int offset,
                       java.lang.String arg)
Insert a string into character data.

Parameters:
offset - The position within the first character at which the string is to be inserted.
arg - The string to insert.

replaceData

public void replaceData(int offset,
                        int count,
                        java.lang.String arg)
Replace characters of character data with a string.

Parameters:
offset - The position within the first character at which the string is to be replaced.
count - The number of characters to be replaced.
arg - The string that replaces the count characters beginning at the character at offset.

setData

public void setData(java.lang.String newValue)
Set the data character string to the new string.

Parameters:
newValue - The new String of data.

setNodeValue

public void setNodeValue(java.lang.String newValue)
Set the data character string to the new string.

Overrides:
setNodeValue in class DomNode
Parameters:
newValue - The new String of data.

substringData

public java.lang.String substringData(int offset,
                                      int count)
Extract a substring from character data.

Parameters:
offset - The position of the first character to be extracted.
count - The number of characters to be extracted.
Returns:
A string that consists of the count characters of the character data starting from the character at position offset.


Copyright © 2003-2016 AppPerfect Corporation. All Rights Reserved.