com.gargoylesoftware.htmlunit.html.impl
Class SimpleRange

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.html.impl.SimpleRange
All Implemented Interfaces:
Serializable, org.w3c.dom.ranges.Range

public class SimpleRange
extends Object
implements org.w3c.dom.ranges.Range, Serializable

Simple implementation of Range.

Version:
$Revision: 5726 $
Author:
Marc Guillemot, Daniel Gredler
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.w3c.dom.ranges.Range
END_TO_END, END_TO_START, START_TO_END, START_TO_START
 
Constructor Summary
SimpleRange()
          Constructs a range without any content.
SimpleRange(Node node)
          Constructs a range for the specified element.
SimpleRange(Node node, int offset)
          Constructs a range for the provided element and start and end offset.
SimpleRange(Node startNode, int startOffset, Node endNode, int endOffset)
          Constructs a range for the provided elements and offsets.
 
Method Summary
 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()
          
 boolean equals(Object obj)
          
 DomDocumentFragment extractContents()
          
 boolean getCollapsed()
          
 Node getCommonAncestorContainer()
          
 Node getEndContainer()
          
 int getEndOffset()
          
 Node getStartContainer()
          
 int getStartOffset()
          
 int hashCode()
          
 void insertNode(Node newNode)
          
 void selectNode(Node node)
          
 void selectNodeContents(Node node)
          
 void setEnd(Node refNode, int offset)
          
 void setEndAfter(Node refNode)
          
 void setEndBefore(Node refNode)
          
 void setStart(Node refNode, int offset)
          
 void setStartAfter(Node refNode)
          
 void setStartBefore(Node refNode)
          
 void surroundContents(Node newParent)
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleRange

public SimpleRange()
Constructs a range without any content.


SimpleRange

public SimpleRange(Node node)
Constructs a range for the specified element.

Parameters:
node - the node for the range

SimpleRange

public SimpleRange(Node node,
                   int offset)
Constructs a range for the provided element and start and end offset.

Parameters:
node - the node for the range
offset - the start and end offset

SimpleRange

public SimpleRange(Node startNode,
                   int startOffset,
                   Node endNode,
                   int endOffset)
Constructs a range for the provided elements and offsets.

Parameters:
startNode - the start node
startOffset - the start offset
endNode - the end node
endOffset - the end offset
Method Detail

cloneContents

public DocumentFragment cloneContents()
                               throws DOMException

Specified by:
cloneContents in interface org.w3c.dom.ranges.Range
Throws:
DOMException

cloneRange

public org.w3c.dom.ranges.Range cloneRange()
                                    throws DOMException

Specified by:
cloneRange in interface org.w3c.dom.ranges.Range
Throws:
DOMException

collapse

public void collapse(boolean toStart)
              throws DOMException

Specified by:
collapse in interface org.w3c.dom.ranges.Range
Throws:
DOMException

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

detach

public void detach()
            throws DOMException

Specified by:
detach in interface org.w3c.dom.ranges.Range
Throws:
DOMException

extractContents

public DomDocumentFragment extractContents()
                                    throws DOMException

Specified by:
extractContents in interface org.w3c.dom.ranges.Range
Throws:
DOMException

getCollapsed

public boolean getCollapsed()
                     throws DOMException

Specified by:
getCollapsed in interface org.w3c.dom.ranges.Range
Throws:
DOMException

getCommonAncestorContainer

public Node getCommonAncestorContainer()
                                throws DOMException

Specified by:
getCommonAncestorContainer in interface org.w3c.dom.ranges.Range
Throws:
DOMException

getEndContainer

public Node getEndContainer()
                     throws DOMException

Specified by:
getEndContainer in interface org.w3c.dom.ranges.Range
Throws:
DOMException

getEndOffset

public int getEndOffset()
                 throws DOMException

Specified by:
getEndOffset in interface org.w3c.dom.ranges.Range
Throws:
DOMException

getStartContainer

public Node getStartContainer()
                       throws DOMException

Specified by:
getStartContainer in interface org.w3c.dom.ranges.Range
Throws:
DOMException

getStartOffset

public int getStartOffset()
                   throws DOMException

Specified by:
getStartOffset 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

selectNode

public void selectNode(Node node)
                throws org.w3c.dom.ranges.RangeException,
                       DOMException

Specified by:
selectNode in interface org.w3c.dom.ranges.Range
Throws:
org.w3c.dom.ranges.RangeException
DOMException

selectNodeContents

public void selectNodeContents(Node node)
                        throws org.w3c.dom.ranges.RangeException,
                               DOMException

Specified by:
selectNodeContents 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

setEndAfter

public void setEndAfter(Node refNode)
                 throws org.w3c.dom.ranges.RangeException,
                        DOMException

Specified by:
setEndAfter in interface org.w3c.dom.ranges.Range
Throws:
org.w3c.dom.ranges.RangeException
DOMException

setEndBefore

public void setEndBefore(Node refNode)
                  throws org.w3c.dom.ranges.RangeException,
                         DOMException

Specified by:
setEndBefore in interface org.w3c.dom.ranges.Range
Throws:
org.w3c.dom.ranges.RangeException
DOMException

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

setStartAfter

public void setStartAfter(Node refNode)
                   throws org.w3c.dom.ranges.RangeException,
                          DOMException

Specified by:
setStartAfter 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,
                           DOMException

Specified by:
setStartBefore in interface org.w3c.dom.ranges.Range
Throws:
org.w3c.dom.ranges.RangeException
DOMException

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

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Specified by:
toString in interface org.w3c.dom.ranges.Range
Overrides:
toString in class Object


Copyright © 2002-2011 Gargoyle Software Inc.. All Rights Reserved.