Class AbstractRange

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.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

    public class AbstractRange
    extends HtmlUnitScriptable
    The JavaScript object that represents a AbstractRange.
    See Also:
    AbstractRange, Serialized Form
    • Nested Class Summary

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

        org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Node endContainer_  
      private int endOffset_  
      private Node startContainer_  
      private int startOffset_  
      • Fields 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

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.Object equivalentValues​(java.lang.Object value)
      java.lang.Object getDefaultValue​(java.lang.Class<?> hint)
      Returns the JavaScript default value of this object.
      java.lang.Object getEndContainer()
      Gets the node within which the Range ends.
      int getEndOffset()
      Gets the offset within the end node of the Range.
      SimpleRange getSimpleRange()  
      java.lang.Object getStartContainer()
      Gets the node within which the Range begins.
      int getStartOffset()
      Gets the offset within the starting node of the Range.
      protected Node internGetEndContainer()  
      protected int internGetEndOffset()  
      protected Node internGetStartContainer()  
      protected int internGetStartOffset()  
      protected void internSetEndContainer​(Node endContainer)  
      protected void internSetEndOffset​(int endOffset)  
      protected void internSetStartContainer​(Node startContainer)  
      protected void internSetStartOffset​(int startOffset)  
      boolean isCollapsed()
      Indicates if the range is collapsed.
      void jsConstructor()
      Creates an instance.
      • 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
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • startContainer_

        private Node startContainer_
      • endContainer_

        private Node endContainer_
      • startOffset_

        private int startOffset_
      • endOffset_

        private int endOffset_
    • Constructor Detail

      • 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 Detail

      • jsConstructor

        public void jsConstructor()
        Creates an instance.
      • internGetStartContainer

        protected Node internGetStartContainer()
      • internSetStartContainer

        protected void internSetStartContainer​(Node startContainer)
      • internGetEndContainer

        protected Node internGetEndContainer()
      • internSetEndContainer

        protected void internSetEndContainer​(Node endContainer)
      • internGetStartOffset

        protected int internGetStartOffset()
      • internSetStartOffset

        protected void internSetStartOffset​(int startOffset)
      • internGetEndOffset

        protected int internGetEndOffset()
      • internSetEndOffset

        protected void internSetEndOffset​(int endOffset)
      • getDefaultValue

        public java.lang.Object getDefaultValue​(java.lang.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 java.lang.Object getStartContainer()
        Gets the node within which the Range begins.
        Returns:
        undefined if not initialized
      • getEndContainer

        public java.lang.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