public abstract class NativeTypedArrayView<T> extends NativeArrayBufferView implements List<T>, RandomAccess, ExternalArrayData
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
NativeTypedArrayView.RealThis |
protected static interface |
NativeTypedArrayView.TypedArrayConstructable |
ScriptableObject.KeyComparator, ScriptableObject.LambdaGetterFunction, ScriptableObject.LambdaSetterFunction| Modifier and Type | Field and Description |
|---|---|
protected int |
length
The length, in elements, of the array
|
arrayBuffer, byteLength, offset, outOfRangeCONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTNOT_FOUND| Modifier | Constructor and Description |
|---|---|
protected |
NativeTypedArrayView() |
protected |
NativeTypedArrayView(NativeArrayBuffer ab,
int off,
int len,
int byteLen) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int i,
T aByte) |
boolean |
add(T aByte) |
boolean |
addAll(Collection<? extends T> bytes) |
boolean |
addAll(int i,
Collection<? extends T> bytes) |
protected boolean |
checkIndex(int index)
Returns
true, if the index is wrong. |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> objects) |
protected boolean |
defineOwnProperty(Context cx,
Object id,
ScriptableObject desc,
boolean checkValid)
Defines a property on an object.
|
void |
delete(int index)
Removes the indexed property from the object.
|
void |
delete(String name)
Removes a named property from the object.
|
protected void |
ensureIndex(int index)
Enusres that the index is in the given range
|
boolean |
equals(Object o) |
Object |
get(int index,
Scriptable start)
Returns the value of the indexed property or NOT_FOUND.
|
Object |
get(String name,
Scriptable start)
Returns the value of the named property or NOT_FOUND.
|
Object |
getArrayElement(int index)
Return the element at the specified index.
|
int |
getArrayLength()
Return the length of the array.
|
abstract int |
getBytesPerElement()
Return the number of bytes represented by each element in the array.
|
Object[] |
getIds()
Returns an array of ids for the properties of the object.
|
boolean |
has(int index,
Scriptable start)
Returns true if the property index is defined.
|
boolean |
has(String name,
Scriptable start)
Returns true if the named property is defined.
|
int |
hashCode() |
int |
indexOf(Object o) |
boolean |
isEmpty() |
boolean |
isTypedArrayOutOfBounds() |
Iterator<T> |
iterator() |
protected static NativeTypedArrayView<?> |
js_constructor(Context cx,
Scriptable scope,
Object[] args,
NativeTypedArrayView.TypedArrayConstructable constructable,
int bytesPerElement) |
protected abstract Object |
js_get(int index) |
protected abstract Object |
js_set(int index,
Object c) |
int |
lastIndexOf(Object o) |
ListIterator<T> |
listIterator() |
ListIterator<T> |
listIterator(int start) |
void |
put(int index,
Scriptable start,
Object val)
Sets the value of the indexed property, creating it if need be.
|
void |
put(String name,
Scriptable start,
Object val)
Sets the value of the named property, creating it if need be.
|
T |
remove(int i) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> objects) |
boolean |
retainAll(Collection<?> objects) |
void |
setArrayElement(int index,
Object value)
Set the element at the specified index.
|
int |
size() |
List<T> |
subList(int i,
int i2) |
Object[] |
toArray() |
<U> U[] |
toArray(U[] ts) |
protected Object |
toNumeric(Object num) |
getBuffer, getByteLength, getByteOffset, isArg, useLittleEndianapplyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChangeForSlot, checkPropertyDefinition, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, equivalentValues, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassName, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototypecreateSlotMapclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitget, replaceAll, set, sort, spliteratorparallelStream, removeIf, streamprotected NativeTypedArrayView()
protected NativeTypedArrayView(NativeArrayBuffer ab, int off, int len, int byteLen)
public Object get(int index, Scriptable start)
ScriptableObjectget in interface Scriptableget in class ScriptableObjectindex - the numeric index for the propertystart - the object in which the lookup beganScriptable.get(String,Scriptable)public Object get(String name, Scriptable start)
ScriptableObjectIf the property was created using defineProperty, the appropriate getter method is called.
get in interface Scriptableget in class ScriptableObjectname - the name of the propertystart - the object in which the lookup beganContext.getUndefinedValue()public boolean has(int index,
Scriptable start)
ScriptableObjecthas in interface Scriptablehas in class ScriptableObjectindex - the numeric index for the propertystart - the object in which the lookup beganScriptable.get(int, Scriptable),
ScriptableObject.getProperty(Scriptable, int)public boolean has(String name, Scriptable start)
ScriptableObjecthas in interface Scriptablehas in class ScriptableObjectname - the name of the propertystart - the object in which the lookup beganScriptable.get(String, Scriptable),
ScriptableObject.getProperty(Scriptable, String)public void put(int index,
Scriptable start,
Object val)
ScriptableObjectput in interface Scriptableput in class ScriptableObjectindex - the numeric index for the propertystart - the object whose property is being setval - value to set the property toScriptable.has(int, Scriptable),
Scriptable.get(int, Scriptable),
ScriptableObject.putProperty(Scriptable, int, Object),
Context.toObject(Object, Scriptable)public void put(String name, Scriptable start, Object val)
ScriptableObjectIf the property was created using defineProperty, the appropriate setter method is called.
If the property's attributes include READONLY, no action is taken. This method will actually set the property in the start object.
put in interface Scriptableput in class ScriptableObjectname - the name of the propertystart - the object whose property is being setval - value to set the property toScriptable.has(String, Scriptable),
Scriptable.get(String, Scriptable),
ScriptableObject.putProperty(Scriptable, String, Object),
Context.toObject(Object, Scriptable)public void delete(int index)
ScriptableObjectIf the property is not found, or it has the PERMANENT attribute, no action is taken.
delete in interface Scriptabledelete in class ScriptableObjectindex - the numeric index for the propertyScriptable.get(int, Scriptable),
ScriptableObject.deleteProperty(Scriptable, int)public void delete(String name)
ScriptableObjectIf the property is not found, or it has the PERMANENT attribute, no action is taken.
delete in interface Scriptabledelete in class ScriptableObjectname - the name of the propertyScriptable.get(String, Scriptable),
ScriptableObject.deleteProperty(Scriptable, String)public Object[] getIds()
ScriptableObjectAny properties with the attribute DONTENUM are not listed.
getIds in interface ScriptablegetIds in class ScriptableObjectprotected boolean defineOwnProperty(Context cx, Object id, ScriptableObject desc, boolean checkValid)
ScriptableObjectBased on [[DefineOwnProperty]] from 8.12.10 of the spec. see [[DefineOwnProperty]]
defineOwnProperty in class ScriptableObjectcx - the current Contextid - the name/index of the propertydesc - the new property descriptor, as described in 8.6.1checkValid - whether to perform validity checksprotected boolean checkIndex(int index)
true, if the index is wrong.protected void ensureIndex(int index)
IndexOutOfBoundsException - when index is out of rangepublic abstract int getBytesPerElement()
protected abstract Object js_get(int index)
protected static NativeTypedArrayView<?> js_constructor(Context cx, Scriptable scope, Object[] args, NativeTypedArrayView.TypedArrayConstructable constructable, int bytesPerElement)
public boolean isTypedArrayOutOfBounds()
public Object getArrayElement(int index)
ExternalArrayDatagetArrayElement in interface ExternalArrayDatapublic void setArrayElement(int index,
Object value)
ExternalArrayDatasetArrayElement in interface ExternalArrayDatapublic int getArrayLength()
ExternalArrayDatagetArrayLength in interface ExternalArrayDatapublic boolean containsAll(Collection<?> objects)
containsAll in interface Collection<T>containsAll in interface List<T>public int lastIndexOf(Object o)
lastIndexOf in interface List<T>public Object[] toArray()
public <U> U[] toArray(U[] ts)
public int size()
size in interface Collection<T>size in interface List<T>size in class ScriptableObjectpublic boolean isEmpty()
isEmpty in interface Collection<T>isEmpty in interface List<T>isEmpty in class ScriptableObjectpublic boolean contains(Object o)
public boolean equals(Object o)
public int hashCode()
public ListIterator<T> listIterator()
listIterator in interface List<T>public ListIterator<T> listIterator(int start)
listIterator in interface List<T>public boolean add(T aByte)
public boolean addAll(Collection<? extends T> bytes)
public boolean addAll(int i,
Collection<? extends T> bytes)
public void clear()
public boolean remove(Object o)
public boolean removeAll(Collection<?> objects)
public boolean retainAll(Collection<?> objects)
Copyright © 2025 HtmlUnit. All rights reserved.