jaxp/src/share/classes/org/w3c/dom/ranges/Range.java
author tonyp
Wed, 19 Aug 2009 12:53:25 -0400
changeset 3691 c84b8483cd2c
parent 6 7f561c08de6b
permissions -rw-r--r--
6871111: G1: remove the concurrent overhead tracker Summary: Removing the concurrent overhead tracker from G1, along with the GC overhead reporter and the G1AccountConcurrentOverhead (both of which rely on the the concurrent overhead tracker). Reviewed-by: iveresov, johnc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * published by the Free Software Foundation.  Sun designates this
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 * particular file as subject to the "Classpath" exception as provided
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * by Sun in the LICENSE file that accompanied this code.
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * accompanied this code).
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * CA 95054 USA or visit www.sun.com if you need additional information or
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 * have any questions.
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
 * This file is available under and governed by the GNU General Public
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
 * License version 2 only, as published by the Free Software Foundation.
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
 * However, the following notice accompanied the original version of this
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
 * file and, per its terms, should not be removed:
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
 * Copyright (c) 2000 World Wide Web Consortium,
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
 * (Massachusetts Institute of Technology, Institut National de
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
 * Recherche en Informatique et en Automatique, Keio University). All
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
 * Rights Reserved. This program is distributed under the W3C's Software
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 * Intellectual Property License. This program is distributed in the
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * PURPOSE.
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
package org.w3c.dom.ranges;
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
import org.w3c.dom.Node;
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
import org.w3c.dom.DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
import org.w3c.dom.DocumentFragment;
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 * @since DOM Level 2
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
public interface Range {
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
     * Node within which the Range begins
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
     *   INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
     *   invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
    public Node getStartContainer()
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
                       throws DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
     * Offset within the starting node of the Range.
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
     *   INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
     *   invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
    public int getStartOffset()
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
                       throws DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
     * Node within which the Range ends
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
     *   INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
     *   invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
    public Node getEndContainer()
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
                       throws DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
     * Offset within the ending node of the Range.
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
     *   INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
     *   invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
    public int getEndOffset()
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
                       throws DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
     * TRUE if the Range is collapsed
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
     *   INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
     *   invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
    public boolean getCollapsed()
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
                       throws DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
     * The deepest common ancestor container of the Range's two
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
     * boundary-points.
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
     *   INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
     *   invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
    public Node getCommonAncestorContainer()
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
                       throws DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
     * Sets the attributes describing the start of the Range.
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
     * @param refNode The <code>refNode</code> value. This parameter must be
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
     *   different from <code>null</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
     * @param offset The <code>startOffset</code> value.
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
     * @exception RangeException
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
     *   INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code> or an ancestor
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
     *   of <code>refNode</code> is an Entity, Notation, or DocumentType
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
     *   node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
     *   INDEX_SIZE_ERR: Raised if <code>offset</code> is negative or greater
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
     *   than the number of child units in <code>refNode</code>. Child units
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
     *   are 16-bit units if <code>refNode</code> is a type of CharacterData
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
     *   node (e.g., a Text or Comment node) or a ProcessingInstruction
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
     *   node. Child units are Nodes in all other cases.
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
     *   <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
     *   been invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
     *   from a different document than the one that created this range.
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
    public void setStart(Node refNode,
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
                         int offset)
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
                         throws RangeException, DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
     * Sets the attributes describing the end of a Range.
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
     * @param refNode The <code>refNode</code> value. This parameter must be
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
     *   different from <code>null</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
     * @param offset The <code>endOffset</code> value.
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
     * @exception RangeException
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
     *   INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code> or an ancestor
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
     *   of <code>refNode</code> is an Entity, Notation, or DocumentType
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
     *   node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
     *   INDEX_SIZE_ERR: Raised if <code>offset</code> is negative or greater
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
     *   than the number of child units in <code>refNode</code>. Child units
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
     *   are 16-bit units if <code>refNode</code> is a type of CharacterData
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
     *   node (e.g., a Text or Comment node) or a ProcessingInstruction
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
     *   node. Child units are Nodes in all other cases.
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
     *   <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
     *   been invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
     *   from a different document than the one that created this range.
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
    public void setEnd(Node refNode,
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
                       int offset)
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
                       throws RangeException, DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
     * Sets the start position to be before a node
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
     * @param refNode Range starts before <code>refNode</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
     * @exception RangeException
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
     *   INVALID_NODE_TYPE_ERR: Raised if the root container of
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
     *   <code>refNode</code> is not an Attr, Document, or DocumentFragment
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
     *   node or if <code>refNode</code> is a Document, DocumentFragment,
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
     *   Attr, Entity, or Notation node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
     *   INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
     *   invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
     *   from a different document than the one that created this range.
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
    public void setStartBefore(Node refNode)
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
                               throws RangeException, DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
     * Sets the start position to be after a node
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
     * @param refNode Range starts after <code>refNode</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
     * @exception RangeException
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
     *   INVALID_NODE_TYPE_ERR: Raised if the root container of
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
     *   <code>refNode</code> is not an Attr, Document, or DocumentFragment
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
     *   node or if <code>refNode</code> is a Document, DocumentFragment,
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
     *   Attr, Entity, or Notation node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
     *   INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
     *   invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
     *   from a different document than the one that created this range.
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
    public void setStartAfter(Node refNode)
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
                              throws RangeException, DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
     * Sets the end position to be before a node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
     * @param refNode Range ends before <code>refNode</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
     * @exception RangeException
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
     *   INVALID_NODE_TYPE_ERR: Raised if the root container of
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
     *   <code>refNode</code> is not an Attr, Document, or DocumentFragment
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
     *   node or if <code>refNode</code> is a Document, DocumentFragment,
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
     *   Attr, Entity, or Notation node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
     *   INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
     *   invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
     *   from a different document than the one that created this range.
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
    public void setEndBefore(Node refNode)
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
                             throws RangeException, DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
     * Sets the end of a Range to be after a node
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
     * @param refNode Range ends after <code>refNode</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
     * @exception RangeException
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
     *   INVALID_NODE_TYPE_ERR: Raised if the root container of
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
     *   <code>refNode</code> is not an Attr, Document or DocumentFragment
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
     *   node or if <code>refNode</code> is a Document, DocumentFragment,
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
     *   Attr, Entity, or Notation node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
     *   INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
     *   invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
     *   from a different document than the one that created this range.
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
    public void setEndAfter(Node refNode)
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
                            throws RangeException, DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
     * Collapse a Range onto one of its boundary-points
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
     * @param toStart If TRUE, collapses the Range onto its start; if FALSE,
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
     *   collapses it onto its end.
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
     *   INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
     *   invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
    public void collapse(boolean toStart)
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
                         throws DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
     * Select a node and its contents
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
     * @param refNode The node to select.
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
     * @exception RangeException
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
     *   INVALID_NODE_TYPE_ERR: Raised if an ancestor of <code>refNode</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
     *   is an Entity, Notation or DocumentType node or if
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
     *   <code>refNode</code> is a Document, DocumentFragment, Attr, Entity,
7f561c08de6b Initial load
duke
parents:
diff changeset
   242
     *   or Notation node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   243
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   244
     *   INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
7f561c08de6b Initial load
duke
parents:
diff changeset
   245
     *   invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   246
     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
7f561c08de6b Initial load
duke
parents:
diff changeset
   247
     *   from a different document than the one that created this range.
7f561c08de6b Initial load
duke
parents:
diff changeset
   248
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   249
    public void selectNode(Node refNode)
7f561c08de6b Initial load
duke
parents:
diff changeset
   250
                           throws RangeException, DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   251
7f561c08de6b Initial load
duke
parents:
diff changeset
   252
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   253
     * Select the contents within a node
7f561c08de6b Initial load
duke
parents:
diff changeset
   254
     * @param refNode Node to select from
7f561c08de6b Initial load
duke
parents:
diff changeset
   255
     * @exception RangeException
7f561c08de6b Initial load
duke
parents:
diff changeset
   256
     *   INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code> or an ancestor
7f561c08de6b Initial load
duke
parents:
diff changeset
   257
     *   of <code>refNode</code> is an Entity, Notation or DocumentType node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   258
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   259
     *   INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
7f561c08de6b Initial load
duke
parents:
diff changeset
   260
     *   invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   261
     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
7f561c08de6b Initial load
duke
parents:
diff changeset
   262
     *   from a different document than the one that created this range.
7f561c08de6b Initial load
duke
parents:
diff changeset
   263
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   264
    public void selectNodeContents(Node refNode)
7f561c08de6b Initial load
duke
parents:
diff changeset
   265
                                   throws RangeException, DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   266
7f561c08de6b Initial load
duke
parents:
diff changeset
   267
    // CompareHow
7f561c08de6b Initial load
duke
parents:
diff changeset
   268
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   269
     * Compare start boundary-point of <code>sourceRange</code> to start
7f561c08de6b Initial load
duke
parents:
diff changeset
   270
     * boundary-point of Range on which <code>compareBoundaryPoints</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   271
     * is invoked.
7f561c08de6b Initial load
duke
parents:
diff changeset
   272
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   273
    public static final short START_TO_START            = 0;
7f561c08de6b Initial load
duke
parents:
diff changeset
   274
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   275
     * Compare start boundary-point of <code>sourceRange</code> to end
7f561c08de6b Initial load
duke
parents:
diff changeset
   276
     * boundary-point of Range on which <code>compareBoundaryPoints</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   277
     * is invoked.
7f561c08de6b Initial load
duke
parents:
diff changeset
   278
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   279
    public static final short START_TO_END              = 1;
7f561c08de6b Initial load
duke
parents:
diff changeset
   280
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   281
     * Compare end boundary-point of <code>sourceRange</code> to end
7f561c08de6b Initial load
duke
parents:
diff changeset
   282
     * boundary-point of Range on which <code>compareBoundaryPoints</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   283
     * is invoked.
7f561c08de6b Initial load
duke
parents:
diff changeset
   284
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   285
    public static final short END_TO_END                = 2;
7f561c08de6b Initial load
duke
parents:
diff changeset
   286
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   287
     * Compare end boundary-point of <code>sourceRange</code> to start
7f561c08de6b Initial load
duke
parents:
diff changeset
   288
     * boundary-point of Range on which <code>compareBoundaryPoints</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   289
     * is invoked.
7f561c08de6b Initial load
duke
parents:
diff changeset
   290
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   291
    public static final short END_TO_START              = 3;
7f561c08de6b Initial load
duke
parents:
diff changeset
   292
7f561c08de6b Initial load
duke
parents:
diff changeset
   293
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   294
     * Compare the boundary-points of two Ranges in a document.
7f561c08de6b Initial load
duke
parents:
diff changeset
   295
     * @param how A code representing the type of comparison, as defined
7f561c08de6b Initial load
duke
parents:
diff changeset
   296
     *   above.
7f561c08de6b Initial load
duke
parents:
diff changeset
   297
     * @param sourceRange The <code>Range</code> on which this current
7f561c08de6b Initial load
duke
parents:
diff changeset
   298
     *   <code>Range</code> is compared to.
7f561c08de6b Initial load
duke
parents:
diff changeset
   299
     * @return  -1, 0 or 1 depending on whether the corresponding
7f561c08de6b Initial load
duke
parents:
diff changeset
   300
     *   boundary-point of the Range is respectively before, equal to, or
7f561c08de6b Initial load
duke
parents:
diff changeset
   301
     *   after the corresponding boundary-point of <code>sourceRange</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   302
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   303
     *   WRONG_DOCUMENT_ERR: Raised if the two Ranges are not in the same
7f561c08de6b Initial load
duke
parents:
diff changeset
   304
     *   Document or DocumentFragment.
7f561c08de6b Initial load
duke
parents:
diff changeset
   305
     *   <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
7f561c08de6b Initial load
duke
parents:
diff changeset
   306
     *   been invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   307
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   308
    public short compareBoundaryPoints(short how,
7f561c08de6b Initial load
duke
parents:
diff changeset
   309
                                       Range sourceRange)
7f561c08de6b Initial load
duke
parents:
diff changeset
   310
                                       throws DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   311
7f561c08de6b Initial load
duke
parents:
diff changeset
   312
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   313
     * Removes the contents of a Range from the containing document or
7f561c08de6b Initial load
duke
parents:
diff changeset
   314
     * document fragment without returning a reference to the removed
7f561c08de6b Initial load
duke
parents:
diff changeset
   315
     * content.
7f561c08de6b Initial load
duke
parents:
diff changeset
   316
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   317
     *   NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of the content of
7f561c08de6b Initial load
duke
parents:
diff changeset
   318
     *   the Range is read-only or any of the nodes that contain any of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   319
     *   content of the Range are read-only.
7f561c08de6b Initial load
duke
parents:
diff changeset
   320
     *   <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
7f561c08de6b Initial load
duke
parents:
diff changeset
   321
     *   been invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   322
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   323
    public void deleteContents()
7f561c08de6b Initial load
duke
parents:
diff changeset
   324
                               throws DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   325
7f561c08de6b Initial load
duke
parents:
diff changeset
   326
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   327
     * Moves the contents of a Range from the containing document or document
7f561c08de6b Initial load
duke
parents:
diff changeset
   328
     * fragment to a new DocumentFragment.
7f561c08de6b Initial load
duke
parents:
diff changeset
   329
     * @return A DocumentFragment containing the extracted contents.
7f561c08de6b Initial load
duke
parents:
diff changeset
   330
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   331
     *   NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of the content of
7f561c08de6b Initial load
duke
parents:
diff changeset
   332
     *   the Range is read-only or any of the nodes which contain any of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   333
     *   content of the Range are read-only.
7f561c08de6b Initial load
duke
parents:
diff changeset
   334
     *   <br>HIERARCHY_REQUEST_ERR: Raised if a DocumentType node would be
7f561c08de6b Initial load
duke
parents:
diff changeset
   335
     *   extracted into the new DocumentFragment.
7f561c08de6b Initial load
duke
parents:
diff changeset
   336
     *   <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
7f561c08de6b Initial load
duke
parents:
diff changeset
   337
     *   been invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   338
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   339
    public DocumentFragment extractContents()
7f561c08de6b Initial load
duke
parents:
diff changeset
   340
                                            throws DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   341
7f561c08de6b Initial load
duke
parents:
diff changeset
   342
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   343
     * Duplicates the contents of a Range
7f561c08de6b Initial load
duke
parents:
diff changeset
   344
     * @return A DocumentFragment that contains content equivalent to this
7f561c08de6b Initial load
duke
parents:
diff changeset
   345
     *   Range.
7f561c08de6b Initial load
duke
parents:
diff changeset
   346
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   347
     *   HIERARCHY_REQUEST_ERR: Raised if a DocumentType node would be
7f561c08de6b Initial load
duke
parents:
diff changeset
   348
     *   extracted into the new DocumentFragment.
7f561c08de6b Initial load
duke
parents:
diff changeset
   349
     *   <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
7f561c08de6b Initial load
duke
parents:
diff changeset
   350
     *   been invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   351
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   352
    public DocumentFragment cloneContents()
7f561c08de6b Initial load
duke
parents:
diff changeset
   353
                                          throws DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   354
7f561c08de6b Initial load
duke
parents:
diff changeset
   355
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   356
     * Inserts a node into the Document or DocumentFragment at the start of
7f561c08de6b Initial load
duke
parents:
diff changeset
   357
     * the Range. If the container is a Text node, this will be split at the
7f561c08de6b Initial load
duke
parents:
diff changeset
   358
     * start of the Range (as if the Text node's splitText method was
7f561c08de6b Initial load
duke
parents:
diff changeset
   359
     * performed at the insertion point) and the insertion will occur
7f561c08de6b Initial load
duke
parents:
diff changeset
   360
     * between the two resulting Text nodes. Adjacent Text nodes will not be
7f561c08de6b Initial load
duke
parents:
diff changeset
   361
     * automatically merged. If the node to be inserted is a
7f561c08de6b Initial load
duke
parents:
diff changeset
   362
     * DocumentFragment node, the children will be inserted rather than the
7f561c08de6b Initial load
duke
parents:
diff changeset
   363
     * DocumentFragment node itself.
7f561c08de6b Initial load
duke
parents:
diff changeset
   364
     * @param newNode The node to insert at the start of the Range
7f561c08de6b Initial load
duke
parents:
diff changeset
   365
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   366
     *   NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   367
     *   start of the Range is read-only.
7f561c08de6b Initial load
duke
parents:
diff changeset
   368
     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>newNode</code> and the
7f561c08de6b Initial load
duke
parents:
diff changeset
   369
     *   container of the start of the Range were not created from the same
7f561c08de6b Initial load
duke
parents:
diff changeset
   370
     *   document.
7f561c08de6b Initial load
duke
parents:
diff changeset
   371
     *   <br>HIERARCHY_REQUEST_ERR: Raised if the container of the start of
7f561c08de6b Initial load
duke
parents:
diff changeset
   372
     *   the Range is of a type that does not allow children of the type of
7f561c08de6b Initial load
duke
parents:
diff changeset
   373
     *   <code>newNode</code> or if <code>newNode</code> is an ancestor of
7f561c08de6b Initial load
duke
parents:
diff changeset
   374
     *   the container.
7f561c08de6b Initial load
duke
parents:
diff changeset
   375
     *   <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
7f561c08de6b Initial load
duke
parents:
diff changeset
   376
     *   been invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   377
     * @exception RangeException
7f561c08de6b Initial load
duke
parents:
diff changeset
   378
     *   INVALID_NODE_TYPE_ERR: Raised if <code>newNode</code> is an Attr,
7f561c08de6b Initial load
duke
parents:
diff changeset
   379
     *   Entity, Notation, or Document node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   380
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   381
    public void insertNode(Node newNode)
7f561c08de6b Initial load
duke
parents:
diff changeset
   382
                           throws DOMException, RangeException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   383
7f561c08de6b Initial load
duke
parents:
diff changeset
   384
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   385
     * Reparents the contents of the Range to the given node and inserts the
7f561c08de6b Initial load
duke
parents:
diff changeset
   386
     * node at the position of the start of the Range.
7f561c08de6b Initial load
duke
parents:
diff changeset
   387
     * @param newParent The node to surround the contents with.
7f561c08de6b Initial load
duke
parents:
diff changeset
   388
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   389
     *   NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of
7f561c08de6b Initial load
duke
parents:
diff changeset
   390
     *   either boundary-point of the Range is read-only.
7f561c08de6b Initial load
duke
parents:
diff changeset
   391
     *   <br>WRONG_DOCUMENT_ERR: Raised if <code> newParent</code> and the
7f561c08de6b Initial load
duke
parents:
diff changeset
   392
     *   container of the start of the Range were not created from the same
7f561c08de6b Initial load
duke
parents:
diff changeset
   393
     *   document.
7f561c08de6b Initial load
duke
parents:
diff changeset
   394
     *   <br>HIERARCHY_REQUEST_ERR: Raised if the container of the start of
7f561c08de6b Initial load
duke
parents:
diff changeset
   395
     *   the Range is of a type that does not allow children of the type of
7f561c08de6b Initial load
duke
parents:
diff changeset
   396
     *   <code>newParent</code> or if <code>newParent</code> is an ancestor
7f561c08de6b Initial load
duke
parents:
diff changeset
   397
     *   of the container or if <code>node</code> would end up with a child
7f561c08de6b Initial load
duke
parents:
diff changeset
   398
     *   node of a type not allowed by the type of <code>node</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   399
     *   <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
7f561c08de6b Initial load
duke
parents:
diff changeset
   400
     *   been invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   401
     * @exception RangeException
7f561c08de6b Initial load
duke
parents:
diff changeset
   402
     *   BAD_BOUNDARYPOINTS_ERR: Raised if the Range partially selects a
7f561c08de6b Initial load
duke
parents:
diff changeset
   403
     *   non-text node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   404
     *   <br>INVALID_NODE_TYPE_ERR: Raised if <code> node</code> is an Attr,
7f561c08de6b Initial load
duke
parents:
diff changeset
   405
     *   Entity, DocumentType, Notation, Document, or DocumentFragment node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   406
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   407
    public void surroundContents(Node newParent)
7f561c08de6b Initial load
duke
parents:
diff changeset
   408
                                 throws DOMException, RangeException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   409
7f561c08de6b Initial load
duke
parents:
diff changeset
   410
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   411
     * Produces a new Range whose boundary-points are equal to the
7f561c08de6b Initial load
duke
parents:
diff changeset
   412
     * boundary-points of the Range.
7f561c08de6b Initial load
duke
parents:
diff changeset
   413
     * @return The duplicated Range.
7f561c08de6b Initial load
duke
parents:
diff changeset
   414
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   415
     *   INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
7f561c08de6b Initial load
duke
parents:
diff changeset
   416
     *   invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   417
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   418
    public Range cloneRange()
7f561c08de6b Initial load
duke
parents:
diff changeset
   419
                            throws DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   420
7f561c08de6b Initial load
duke
parents:
diff changeset
   421
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   422
     * Returns the contents of a Range as a string. This string contains only
7f561c08de6b Initial load
duke
parents:
diff changeset
   423
     * the data characters, not any markup.
7f561c08de6b Initial load
duke
parents:
diff changeset
   424
     * @return The contents of the Range.
7f561c08de6b Initial load
duke
parents:
diff changeset
   425
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   426
     *   INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
7f561c08de6b Initial load
duke
parents:
diff changeset
   427
     *   invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   428
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   429
    public String toString()
7f561c08de6b Initial load
duke
parents:
diff changeset
   430
                           throws DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   431
7f561c08de6b Initial load
duke
parents:
diff changeset
   432
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   433
     * Called to indicate that the Range is no longer in use and that the
7f561c08de6b Initial load
duke
parents:
diff changeset
   434
     * implementation may relinquish any resources associated with this
7f561c08de6b Initial load
duke
parents:
diff changeset
   435
     * Range. Subsequent calls to any methods or attribute getters on this
7f561c08de6b Initial load
duke
parents:
diff changeset
   436
     * Range will result in a <code>DOMException</code> being thrown with an
7f561c08de6b Initial load
duke
parents:
diff changeset
   437
     * error code of <code>INVALID_STATE_ERR</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   438
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   439
     *   INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
7f561c08de6b Initial load
duke
parents:
diff changeset
   440
     *   invoked on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   441
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   442
    public void detach()
7f561c08de6b Initial load
duke
parents:
diff changeset
   443
                       throws DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   444
7f561c08de6b Initial load
duke
parents:
diff changeset
   445
}