public class NodeList extends AbstractList implements org.htmlunit.corejs.javascript.Callable
document.all
,
document.all.tags('x')
, document.forms
, window.frames
, etc.
Note that this class must not be used for collections that can be modified, for example
map.areas
and select.options
.AbstractList.EffectOnCache
org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
NOT_FOUND
Constructor and Description |
---|
NodeList()
Creates an instance.
|
NodeList(DomNode domNode,
boolean attributeChangeSensitive)
Creates an instance.
|
NodeList(DomNode domNode,
List<DomNode> initialElements)
Constructs an instance with an initial cache value.
|
Modifier and Type | Method and Description |
---|---|
Object |
call(org.htmlunit.corejs.javascript.Context cx,
org.htmlunit.corejs.javascript.Scriptable scope,
org.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args) |
protected AbstractList |
create(DomNode parentScope,
List<DomNode> initialElements)
Constructs a new instance with an initial cache value.
|
org.htmlunit.corejs.javascript.Scriptable |
entries()
Returns an Iterator allowing to go through all key/value pairs contained in this object.
|
void |
forEach(Object callback)
Calls the
callback given in parameter once for each value pair in the list, in insertion order. |
int |
getLength()
Returns the length.
|
Object |
item(Object index)
Returns the item or items corresponding to the specified index or key.
|
void |
jsConstructor()
JavaScript constructor.
|
org.htmlunit.corejs.javascript.Scriptable |
keys()
Returns an Iterator allowing to go through all keys contained in this object.
|
static NodeList |
staticNodeList(HtmlUnitScriptable parentScope,
List<DomNode> elements)
Gets a static NodeList.
|
org.htmlunit.corejs.javascript.Scriptable |
values()
Returns an Iterator allowing to go through all keys contained in this object.
|
avoidObjectDetection, defineProperty, equivalentValues, getArrayElement, getArrayLength, getElements, getElementSupplier, getIsMatchingPredicate, getIt, getScriptableForElement, getWithPreemption, getWithPreemptionByName, setArrayElement, setAvoidObjectDetection, setDomNode, setEffectOnCacheFunction, setElementsSupplier, setIsMatchingPredicate, toString
clone, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getWindow, getWindow, getWindowFromTopCallScope, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setParentScope, setupPromise, setupRejectedPromise
applyDescriptorToAttributeBitset, associateValue, 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
public NodeList()
public NodeList(DomNode domNode, boolean attributeChangeSensitive)
domNode
- the DomNode
attributeChangeSensitive
- indicates if the content of the collection may change when an attribute
of a descendant node of parentScope changes (attribute added, modified or removed)public void jsConstructor()
public static NodeList staticNodeList(HtmlUnitScriptable parentScope, List<DomNode> elements)
parentScope
- the parent scopeelements
- the elementspublic org.htmlunit.corejs.javascript.Scriptable keys()
public org.htmlunit.corejs.javascript.Scriptable values()
public org.htmlunit.corejs.javascript.Scriptable entries()
public void forEach(Object callback)
callback
given in parameter once for each value pair in the list, in insertion order.callback
- function to execute for each elementpublic final int getLength()
getLength
in class AbstractList
public Object item(Object index)
index
- the index or key corresponding to the element or elements to returnpublic Object call(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args)
call
in interface org.htmlunit.corejs.javascript.Callable
protected AbstractList create(DomNode parentScope, List<DomNode> initialElements)
create
in class AbstractList
parentScope
- the parent scope, on which we listen for changesinitialElements
- the initial content for the cacheCopyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.