public class SimpleArray extends SimpleScriptable implements ScriptableWithFallbackGetter
SimpleArray
allowing access per key and index (like MimeTypeArray
).Constructor and Description |
---|
SimpleArray() |
Modifier and Type | Method and Description |
---|---|
Object |
get(int index,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
Returns the element at the specified index, or
null if the index is invalid. |
protected String |
getItemName(Object element)
Gets the name of the element.
|
int |
getLength()
Gets the array size.
|
Object |
getWithFallback(String name)
Fallback called when no configured property is found with the given name
on the
Scriptable object. |
Object |
item(int index)
Returns the item at the given index.
|
Object |
namedItem(String name)
Returns the item at the given index.
|
clone, equivalentValues, get, getBrowserVersion, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement
defineFunctionProperties, defineProperty, getClassName, setClassName, setParentScope
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setPrototype, size
public Object item(int index)
index
- the indexpublic Object getWithFallback(String name)
Scriptable
object.getWithFallback
in interface ScriptableWithFallbackGetter
name
- the name of the requested propertyScriptable.NOT_FOUND
if nothing is foundpublic final Object get(int index, net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
null
if the index is invalid.
get
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
get
in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
public Object namedItem(String name)
name
- the item nameprotected String getItemName(Object element)
element
- the array's elementpublic int getLength()
Copyright © 2002–2017 Gargoyle Software Inc.. All rights reserved.