Class RangeImpl

  • All Implemented Interfaces:
    org.w3c.dom.ranges.Range

    public class RangeImpl
    extends Object
    implements org.w3c.dom.ranges.Range
    The RangeImpl class implements the org.w3c.dom.range.Range interface.

    Please see the API documentation for the interface classes and use the interfaces in your client programs.

    Version:
    $Id$
    • Constructor Detail

      • RangeImpl

        public RangeImpl​(DocumentImpl document)
        The constructor. Clients must use DocumentRange.createRange(), because it registers the Range with the document, so it can be fixed-up.
    • Method Detail

      • getStartContainer

        public Node getStartContainer()
        Specified by:
        getStartContainer in interface org.w3c.dom.ranges.Range
      • getStartOffset

        public int getStartOffset()
        Specified by:
        getStartOffset in interface org.w3c.dom.ranges.Range
      • getEndContainer

        public Node getEndContainer()
        Specified by:
        getEndContainer in interface org.w3c.dom.ranges.Range
      • getEndOffset

        public int getEndOffset()
        Specified by:
        getEndOffset in interface org.w3c.dom.ranges.Range
      • getCollapsed

        public boolean getCollapsed()
        Specified by:
        getCollapsed in interface org.w3c.dom.ranges.Range
      • getCommonAncestorContainer

        public Node getCommonAncestorContainer()
        Specified by:
        getCommonAncestorContainer in interface org.w3c.dom.ranges.Range
      • setStart

        public void setStart​(Node refNode,
                             int offset)
                      throws org.w3c.dom.ranges.RangeException,
                             DOMException
        Specified by:
        setStart in interface org.w3c.dom.ranges.Range
        Throws:
        org.w3c.dom.ranges.RangeException
        DOMException
      • setEnd

        public void setEnd​(Node refNode,
                           int offset)
                    throws org.w3c.dom.ranges.RangeException,
                           DOMException
        Specified by:
        setEnd in interface org.w3c.dom.ranges.Range
        Throws:
        org.w3c.dom.ranges.RangeException
        DOMException
      • setStartBefore

        public void setStartBefore​(Node refNode)
                            throws org.w3c.dom.ranges.RangeException
        Specified by:
        setStartBefore in interface org.w3c.dom.ranges.Range
        Throws:
        org.w3c.dom.ranges.RangeException
      • setStartAfter

        public void setStartAfter​(Node refNode)
                           throws org.w3c.dom.ranges.RangeException
        Specified by:
        setStartAfter in interface org.w3c.dom.ranges.Range
        Throws:
        org.w3c.dom.ranges.RangeException
      • setEndBefore

        public void setEndBefore​(Node refNode)
                          throws org.w3c.dom.ranges.RangeException
        Specified by:
        setEndBefore in interface org.w3c.dom.ranges.Range
        Throws:
        org.w3c.dom.ranges.RangeException
      • setEndAfter

        public void setEndAfter​(Node refNode)
                         throws org.w3c.dom.ranges.RangeException
        Specified by:
        setEndAfter in interface org.w3c.dom.ranges.Range
        Throws:
        org.w3c.dom.ranges.RangeException
      • collapse

        public void collapse​(boolean toStart)
        Specified by:
        collapse in interface org.w3c.dom.ranges.Range
      • selectNode

        public void selectNode​(Node refNode)
                        throws org.w3c.dom.ranges.RangeException
        Specified by:
        selectNode in interface org.w3c.dom.ranges.Range
        Throws:
        org.w3c.dom.ranges.RangeException
      • selectNodeContents

        public void selectNodeContents​(Node refNode)
                                throws org.w3c.dom.ranges.RangeException
        Specified by:
        selectNodeContents in interface org.w3c.dom.ranges.Range
        Throws:
        org.w3c.dom.ranges.RangeException
      • compareBoundaryPoints

        public short compareBoundaryPoints​(short how,
                                           org.w3c.dom.ranges.Range sourceRange)
                                    throws DOMException
        Specified by:
        compareBoundaryPoints in interface org.w3c.dom.ranges.Range
        Throws:
        DOMException
      • deleteContents

        public void deleteContents()
                            throws DOMException
        Specified by:
        deleteContents in interface org.w3c.dom.ranges.Range
        Throws:
        DOMException
      • insertNode

        public void insertNode​(Node newNode)
                        throws DOMException,
                               org.w3c.dom.ranges.RangeException
        Specified by:
        insertNode in interface org.w3c.dom.ranges.Range
        Throws:
        DOMException
        org.w3c.dom.ranges.RangeException
      • surroundContents

        public void surroundContents​(Node newParent)
                              throws DOMException,
                                     org.w3c.dom.ranges.RangeException
        Specified by:
        surroundContents in interface org.w3c.dom.ranges.Range
        Throws:
        DOMException
        org.w3c.dom.ranges.RangeException
      • cloneRange

        public org.w3c.dom.ranges.Range cloneRange()
        Specified by:
        cloneRange in interface org.w3c.dom.ranges.Range
      • toString

        public String toString()
        Specified by:
        toString in interface org.w3c.dom.ranges.Range
        Overrides:
        toString in class Object
      • detach

        public void detach()
        Specified by:
        detach in interface org.w3c.dom.ranges.Range
      • insertedNodeFromDOM

        public void insertedNodeFromDOM​(Node node)
        This function is called from the DOM. This node has already been inserted into the DOM. Fix-up any offsets.