org.apache.xerces.dom

Class RangeImpl

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

public class RangeImpl
extends java.lang.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: RangeImpl.java 388860 2006-03-25 23:50:16Z mrglavas $

Fields inherited from interface org.w3c.dom.ranges.Range

END_TO_END, END_TO_START, START_TO_END, START_TO_START

Constructor Summary

RangeImpl(DocumentImpl document)
The constructor.

Method Summary

org.w3c.dom.DocumentFragment
cloneContents()
org.w3c.dom.ranges.Range
cloneRange()
void
collapse(boolean toStart)
short
compareBoundaryPoints(short how, org.w3c.dom.ranges.Range sourceRange)
void
deleteContents()
void
detach()
org.w3c.dom.DocumentFragment
extractContents()
boolean
getCollapsed()
org.w3c.dom.Node
getCommonAncestorContainer()
org.w3c.dom.Node
getEndContainer()
int
getEndOffset()
org.w3c.dom.Node
getStartContainer()
int
getStartOffset()
void
insertNode(org.w3c.dom.Node newNode)
void
insertedNodeFromDOM(org.w3c.dom.Node node)
This function is called from the DOM.
void
selectNode(org.w3c.dom.Node refNode)
void
selectNodeContents(org.w3c.dom.Node refNode)
void
setEnd(org.w3c.dom.Node refNode, int offset)
void
setEndAfter(org.w3c.dom.Node refNode)
void
setEndBefore(org.w3c.dom.Node refNode)
void
setStart(org.w3c.dom.Node refNode, int offset)
void
setStartAfter(org.w3c.dom.Node refNode)
void
setStartBefore(org.w3c.dom.Node refNode)
void
surroundContents(org.w3c.dom.Node newParent)
String
toString()

Constructor Details

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 Details

cloneContents

public org.w3c.dom.DocumentFragment cloneContents()
            throws org.w3c.dom.DOMException
Specified by:
cloneContents in interface org.w3c.dom.ranges.Range

cloneRange

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

collapse

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

compareBoundaryPoints

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

deleteContents

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

detach

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

extractContents

public org.w3c.dom.DocumentFragment extractContents()
            throws org.w3c.dom.DOMException
Specified by:
extractContents in interface org.w3c.dom.ranges.Range

getCollapsed

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

getCommonAncestorContainer

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

getEndContainer

public org.w3c.dom.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

getStartContainer

public org.w3c.dom.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

insertNode

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

insertedNodeFromDOM

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

selectNode

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

selectNodeContents

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

setEnd

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

setEndAfter

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

setEndBefore

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

setStart

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

setStartAfter

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

setStartBefore

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

surroundContents

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

toString

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

Copyright B) 1999-2006 The Apache Software Foundation. All Rights Reserved.