Class TextSpan

  • All Implemented Interfaces:
    java.lang.Iterable<Node>, Sequence<Node>

    public class TextSpan
    extends Element
    Element representing an inline range of styled characters.
    • Constructor Detail

      • TextSpan

        public TextSpan()
      • TextSpan

        public TextSpan​(TextSpan span,
                        boolean recursive)
      • TextSpan

        public TextSpan​(java.lang.String text)
    • Method Detail

      • add

        public int add​(java.lang.String text)
      • insert

        public void insert​(Node node,
                           int index)
        Description copied from interface: Sequence
        Inserts an item into the sequence at a specific index.
        Specified by:
        insert in interface Sequence<Node>
        Overrides:
        insert in class Element
        Parameters:
        node - The item to be added to the sequence.
        index - The index at which the item should be inserted. Must be a value between 0 and getLength().
      • duplicate

        public TextSpan duplicate​(boolean recursive)
        Description copied from class: Node
        Creates a copy of this node.
        Specified by:
        duplicate in class Element
        Parameters:
        recursive - Whether to duplicate the children also.
        Returns:
        A copy of the current node.
      • getRange

        public TextSpan getRange​(int offset,
                                 int characterCount)
        Description copied from class: Node
        Returns a range from the node.
        Overrides:
        getRange in class Element
        Parameters:
        offset - Offset relative to this node.
        characterCount - Count of characters to get.
        Returns:
        A node containing a copy of the node structure spanning the given range, relative to this node.