Class Text


  • public class Text
    extends Node
    The Text interface represents textual content.
    • Constructor Detail

      • Text

        protected Text()
    • Method Detail

      • 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.