Module org.htmlunit

Class AbstractRange

java.lang.Object
org.htmlunit.corejs.javascript.SlotMapOwner<org.htmlunit.corejs.javascript.Scriptable>
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.Scriptable>, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.PropHolder<org.htmlunit.corejs.javascript.Scriptable>, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable
Direct Known Subclasses:
Range

public class AbstractRange extends HtmlUnitScriptable
The JavaScript object that represents a AbstractRange.
Author:
Ronald Brill
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    org.htmlunit.corejs.javascript.ScriptableObject.DescriptorInfo, org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator, org.htmlunit.corejs.javascript.ScriptableObject.LambdaGetterFunction, org.htmlunit.corejs.javascript.ScriptableObject.LambdaSetterFunction
  • Field Summary

    Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST

    Fields inherited from class org.htmlunit.corejs.javascript.SlotMapOwner

    isSealed

    Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable

    NOT_FOUND
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    Creates an instance.
    protected
    AbstractRange(Node startContainer, Node endContainer, int startOffset, int endOffset)
    Creates a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Object
    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
    Sets the end container.
    protected void
    internSetEndOffset(int endOffset)
    Sets the end offset.
    protected void
    internSetStartContainer(Node startContainer)
    Sets the start container.
    protected void
    internSetStartOffset(int startOffset)
    Sets the start offset.
    boolean
    Indicates if the range is collapsed.
    void
    Creates an instance.

    Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    applyDescriptorToAttributeBitset, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkNotSealed, checkPropertyChangeForSlot, checkPropertyChangeForSlot, checkPropertyDefinition, checkPropertyDefinition, checkSlotRemoval, defineBuiltinProperty, defineBuiltinProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, get, get, getAllIds, getAncestor, getArrayPrototype, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getThis, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, hasProperty, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGenericDescriptor, isGetterOrSetter, isGetterOrSetter, isTrue, preventExtensions, put, put, putConst, putConstProperty, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, redefineProperty, sameValue, sealObject, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size

    Methods inherited from class org.htmlunit.corejs.javascript.SlotMapOwner

    associateValue, checkNotSealed, copyAssociatedValue, createSlotMap, defineProperty, defineProperty, get, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getIds, has, has, isSealed, readMaps, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, writeMaps

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.htmlunit.corejs.javascript.Scriptable

    get, getIds, has, has

    Methods inherited from interface org.htmlunit.corejs.javascript.SymbolScriptable

    get, has
  • Constructor Details

    • AbstractRange

      public AbstractRange()
      Creates an instance.
    • AbstractRange

      protected AbstractRange(Node startContainer, Node endContainer, int startOffset, int endOffset)
      Creates a new instance.
      Parameters:
      startContainer - the start node
      endContainer - the end node
      startOffset - the start offset
      endOffset - the end offset
  • Method Details

    • jsConstructor

      public void jsConstructor()
      Creates an instance.
    • internGetStartContainer

      protected Node internGetStartContainer()
      Returns:
      the start container
    • internSetStartContainer

      protected void internSetStartContainer(Node startContainer)
      Sets the start container.
      Parameters:
      startContainer - the new start container
    • internGetEndContainer

      protected Node internGetEndContainer()
      Returns:
      the end container
    • internSetEndContainer

      protected void internSetEndContainer(Node endContainer)
      Sets the end container.
      Parameters:
      endContainer - the new end container
    • internGetStartOffset

      protected int internGetStartOffset()
      Returns:
      the start offset
    • internSetStartOffset

      protected void internSetStartOffset(int startOffset)
      Sets the start offset.
      Parameters:
      startOffset - the new start offset
    • internGetEndOffset

      protected int internGetEndOffset()
      Returns:
      the end offset
    • internSetEndOffset

      protected void internSetEndOffset(int endOffset)
      Sets the end offset.
      Parameters:
      endOffset - the new end offset
    • getDefaultValue

      public Object getDefaultValue(Class<?> hint)
      Returns the JavaScript default value of this object. This is the JavaScript equivalent of a toString() in Java.
      Specified by:
      getDefaultValue in interface org.htmlunit.corejs.javascript.Scriptable
      Overrides:
      getDefaultValue in class HtmlUnitScriptable
      Parameters:
      hint - a hint as to the format of the default value (ignored in this case)
      Returns:
      the default value
    • getStartContainer

      public Object getStartContainer()
      Gets the node within which the Range begins.
      Returns:
      undefined if not initialized
    • getEndContainer

      public Object 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

      public SimpleRange getSimpleRange()
      Returns:
      a SimpleRange version of this object
    • equivalentValues

      protected Object equivalentValues(Object value)
      Description copied from class: HtmlUnitScriptable
      Overrides:
      equivalentValues in class HtmlUnitScriptable