Package com.google.gwt.dom.client

## Class Text

- java.lang.Object
- - com.google.gwt.core.client.JavaScriptObject
  - - com.google.gwt.dom.client.Node
    - - com.google.gwt.dom.client.Text

-     public class Text
      extends Node

  The Text interface represents textual content.

- - ### Field Summary

    - ### Fields inherited from class com.google.gwt.dom.client.Node

      `DOCUMENT_NODE, ELEMENT_NODE, TEXT_NODE`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `Text()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static Text` | `as​(Node node)` | Assert that the given `Node` is of type `Node.TEXT_NODE` and automatically typecast it.
    `void` | `deleteData​(int offset, int length)` | Deletes data at the given [offset, length] range.
    `java.lang.String` | `getData()` | The character data of this text node.
    `int` | `getLength()` | The number of characters available through the data property.
    `void` | `insertData​(int offset, java.lang.String data)` | Inserts character data at the given offset.
    `void` | `replaceData​(int offset, int length, java.lang.String data)` | Replaces data at the given [offset, length] range with the given string.
    `void` | `setData​(java.lang.String data)` | The character data of this text node.
    `Text` | `splitText​(int offset)` | Splits the data in this node into two separate text nodes.

    - ### Methods inherited from class com.google.gwt.dom.client.Node

      `appendChild, as, cloneNode, getChild, getChildCount, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPreviousSibling, hasChildNodes, hasParentElement, insertAfter, insertBefore, insertFirst, is, isOrHasChild, removeAllChildren, removeChild, removeFromParent, replaceChild, setNodeValue`

    - ### Methods inherited from class com.google.gwt.core.client.JavaScriptObject

      `cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Text

          protected Text()

  - ### Method Detail

    - #### as

          public static Text as​(Node node)

      Assert that the given `Node` is of type `Node.TEXT_NODE` and automatically typecast it.

    - #### deleteData

          public final void deleteData​(int offset,
                                       int length)

      Deletes data at the given [offset, length] range.

    - #### getData

          public final java.lang.String getData()

      The character data of this text node.

    - #### getLength

          public final int getLength()

      The number of characters available through the data property.

    - #### insertData

          public final void insertData​(int offset,
                                       java.lang.String data)

      Inserts character data at the given offset.

    - #### replaceData

          public final void replaceData​(int offset,
                                        int length,
                                        java.lang.String data)

      Replaces data at the given [offset, length] range with the given string.

    - #### setData

          public final void setData​(java.lang.String data)

      The character data of this text node.

    - #### splitText

          public final Text splitText​(int offset)

      Splits the data in this node into two separate text nodes. The text before the split offset is kept in this node, and a new sibling node is created to contain the text after the offset.