Package org.htmlunit.javascript.host.dom
Class AbstractRange
java.lang.Object
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.dom.AbstractRange
- All Implemented Interfaces:
Serializable
,Cloneable
,org.htmlunit.corejs.javascript.ConstProperties
,org.htmlunit.corejs.javascript.debug.DebuggableObject
,org.htmlunit.corejs.javascript.Scriptable
,org.htmlunit.corejs.javascript.SymbolScriptable
- Direct Known Subclasses:
Range
The JavaScript object that represents a AbstractRange.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
-
Field Summary
FieldsFields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
-
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates an instance.protected
AbstractRange
(Node startContainer, Node endContainer, int startOffset, int endOffset) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
equivalentValues
(Object value) getDefaultValue
(Class<?> hint) Returns the JavaScript default value of this object.Gets the node within which the Range ends.int
Gets the offset within the end node of the Range.Gets the node within which the Range begins.int
Gets the offset within the starting node of the Range.protected Node
protected int
protected Node
protected int
protected void
internSetEndContainer
(Node endContainer) protected void
internSetEndOffset
(int endOffset) protected void
internSetStartContainer
(Node startContainer) protected void
internSetStartOffset
(int startOffset) boolean
Indicates if the range is collapsed.void
Creates an instance.Methods inherited from class org.htmlunit.javascript.HtmlUnitScriptable
clone, get, getBrowserVersion, getClassName, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromise
Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
-
Field Details
-
startContainer_
-
endContainer_
-
startOffset_
private int startOffset_ -
endOffset_
private int endOffset_
-
-
Constructor Details
-
AbstractRange
public AbstractRange()Creates an instance. -
AbstractRange
Creates a new instance.- Parameters:
startContainer
- the start nodeendContainer
- the end nodestartOffset
- the start offsetendOffset
- the end offset
-
-
Method Details
-
jsConstructor
public void jsConstructor()Creates an instance. -
internGetStartContainer
-
internSetStartContainer
-
internGetEndContainer
-
internSetEndContainer
-
internGetStartOffset
protected int internGetStartOffset() -
internSetStartOffset
protected void internSetStartOffset(int startOffset) -
internGetEndOffset
protected int internGetEndOffset() -
internSetEndOffset
protected void internSetEndOffset(int endOffset) -
getDefaultValue
Returns the JavaScript default value of this object. This is the JavaScript equivalent of a toString() in Java.- Specified by:
getDefaultValue
in interfaceorg.htmlunit.corejs.javascript.Scriptable
- Overrides:
getDefaultValue
in classHtmlUnitScriptable
- Parameters:
hint
- a hint as to the format of the default value (ignored in this case)- Returns:
- the default value
-
getStartContainer
Gets the node within which the Range begins.- Returns:
undefined
if not initialized
-
getEndContainer
Gets the node within which the Range ends.- Returns:
undefined
if not initialized
-
getStartOffset
public int getStartOffset()Gets the offset within the starting node of the Range.- Returns:
0
if not initialized
-
getEndOffset
public int getEndOffset()Gets the offset within the end node of the Range.- Returns:
0
if not initialized
-
isCollapsed
public boolean isCollapsed()Indicates if the range is collapsed.- Returns:
true
if the range is collapsed
-
getSimpleRange
- Returns:
- a
SimpleRange
version of this object
-
equivalentValues
Description copied from class:HtmlUnitScriptable
- Overrides:
equivalentValues
in classHtmlUnitScriptable
-