Class NativeTypedArrayView<T>
java.lang.Object
org.mozilla.javascript.ScriptableObject
org.mozilla.javascript.IdScriptableObject
org.mozilla.javascript.typedarrays.NativeArrayBufferView
org.mozilla.javascript.typedarrays.NativeTypedArrayView<T>
- All Implemented Interfaces:
Serializable,Iterable<T>,Collection<T>,List<T>,RandomAccess,SequencedCollection<T>,ConstProperties,DebuggableObject,ExternalArrayData,IdFunctionCall,Scriptable
- Direct Known Subclasses:
NativeFloat32Array,NativeFloat64Array,NativeInt16Array,NativeInt32Array,NativeInt8Array,NativeUint16Array,NativeUint32Array,NativeUint8Array,NativeUint8ClampedArray
public abstract class NativeTypedArrayView<T>
extends NativeArrayBufferView
implements List<T>, RandomAccess, ExternalArrayData
This class is the abstract parent for all of the various typed arrays. Each one
shows a view of a specific NativeArrayBuffer, and modifications here will affect the rest.
- See Also:
-
Field Summary
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTFields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int i, Collection<? extends T> bytes) booleanaddAll(Collection<? extends T> bytes) voidclear()booleanbooleancontainsAll(Collection<?> objects) voiddelete(int index) Removes the indexed property from the object.booleanexecIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) 'thisObj' will be null if invoked as constructor, in which case instance of Scriptable should be returned.get(int index, Scriptable start) Returns the value of the indexed property or NOT_FOUND.getArrayElement(int index) Return the element at the specified index.intReturn the length of the array.abstract intReturn the number of bytes represented by each element in the array.Object[]getIds()Returns an array of ids for the properties of the object.booleanhas(int index, Scriptable start) Returns true if the property index is defined.inthashCode()intbooleanisEmpty()iterator()intlistIterator(int start) voidput(int index, Scriptable start, Object val) Sets the value of the indexed property, creating it if need be.remove(int i) booleanbooleanremoveAll(Collection<?> objects) booleanretainAll(Collection<?> objects) voidsetArrayElement(int index, Object value) Set the element at the specified index.intsize()subList(int i, int i2) Object[]toArray()<U> U[]toArray(U[] ts) Methods inherited from class org.mozilla.javascript.typedarrays.NativeArrayBufferView
getBuffer, getByteLength, getByteOffsetMethods inherited from class org.mozilla.javascript.IdScriptableObject
activatePrototypeMap, defineOwnProperty, delete, exportAsJSClass, get, getAttributes, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeValue, put, setAttributesMethods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineProperty, defineProperty, defineProperty, defineProperty, deleteProperty, deleteProperty, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassName, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGetterOrSetter, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, hasInstance, hasProperty, hasProperty, isConst, isExtensible, isSealed, preventExtensions, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototypeMethods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, get, getFirst, getLast, removeFirst, removeLast, replaceAll, reversed, set, sort, spliterator
-
Method Details
-
get
Description copied from class:ScriptableObjectReturns the value of the indexed property or NOT_FOUND.- Specified by:
getin interfaceScriptable- Overrides:
getin classScriptableObject- Parameters:
index- the numeric index for the propertystart- the object in which the lookup began- Returns:
- the value of the property (may be null), or NOT_FOUND
- See Also:
-
has
Description copied from class:ScriptableObjectReturns true if the property index is defined.- Specified by:
hasin interfaceScriptable- Overrides:
hasin classScriptableObject- Parameters:
index- the numeric index for the propertystart- the object in which the lookup began- Returns:
- true if and only if the property was found in the object
- See Also:
-
put
Description copied from class:ScriptableObjectSets the value of the indexed property, creating it if need be.- Specified by:
putin interfaceScriptable- Overrides:
putin classScriptableObject- Parameters:
index- the numeric index for the propertystart- the object whose property is being setval- value to set the property to- See Also:
-
delete
public void delete(int index) Description copied from class:ScriptableObjectRemoves the indexed property from the object. If the property is not found, or it has the PERMANENT attribute, no action is taken.- Specified by:
deletein interfaceScriptable- Overrides:
deletein classScriptableObject- Parameters:
index- the numeric index for the property- See Also:
-
getIds
Description copied from class:ScriptableObjectReturns an array of ids for the properties of the object.Any properties with the attribute DONTENUM are not listed.
- Specified by:
getIdsin interfaceScriptable- Overrides:
getIdsin classScriptableObject- Returns:
- an array of java.lang.Objects with an entry for every listed property. Properties accessed via an integer index will have a corresponding Integer entry in the returned array. Properties accessed by a String will have a String entry in the returned array.
-
getBytesPerElement
public abstract int getBytesPerElement()Return the number of bytes represented by each element in the array. This can be useful when wishing to manipulate the byte array directly from Java. -
execIdCall
public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) Description copied from class:IdScriptableObject'thisObj' will be null if invoked as constructor, in which case instance of Scriptable should be returned.- Specified by:
execIdCallin interfaceIdFunctionCall- Overrides:
execIdCallin classIdScriptableObject
-
getArrayElement
Description copied from interface:ExternalArrayDataReturn the element at the specified index. The result must be a type that is valid in JavaScript: Number, String, or Scriptable. This method will not be called unless "index" is in range.- Specified by:
getArrayElementin interfaceExternalArrayData
-
setArrayElement
Description copied from interface:ExternalArrayDataSet the element at the specified index. This method will not be called unless "index" is in range. The method must check that "value" is a valid type, and convert it if necessary.- Specified by:
setArrayElementin interfaceExternalArrayData
-
getArrayLength
public int getArrayLength()Description copied from interface:ExternalArrayDataReturn the length of the array.- Specified by:
getArrayLengthin interfaceExternalArrayData
-
size
public int size()- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein interfaceList<T>- Overrides:
sizein classScriptableObject
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<T>- Specified by:
isEmptyin interfaceList<T>- Overrides:
isEmptyin classScriptableObject
-
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<T>- Specified by:
containsAllin interfaceList<T>
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<T>
-
toArray
-
toArray
public <U> U[] toArray(U[] ts) -
equals
-
hashCode
public int hashCode() -
iterator
-
listIterator
- Specified by:
listIteratorin interfaceList<T>
-
listIterator
- Specified by:
listIteratorin interfaceList<T>
-
subList
-
add
-
add
-
addAll
-
addAll
-
clear
public void clear() -
remove
-
remove
-
removeAll
-
retainAll
-