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:
- java.io.Serializable,- java.lang.Iterable<T>,- java.util.Collection<T>,- java.util.List<T>,- java.util.RandomAccess,- ConstProperties,- DebuggableObject,- ExternalArrayData,- IdFunctionCall,- Scriptable,- SymbolScriptable
 - Direct Known Subclasses:
- NativeFloat32Array,- NativeFloat64Array,- NativeInt16Array,- NativeInt32Array,- NativeInt8Array,- NativeUint16Array,- NativeUint32Array,- NativeUint8Array,- NativeUint8ClampedArray
 
 public abstract class NativeTypedArrayView<T> extends NativeArrayBufferView implements java.util.List<T>, java.util.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:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObjectScriptableObject.KeyComparator
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected intlengthThe length, in elements, of the arrayprotected static intMAX_PROTOTYPE_ID- 
Fields inherited from class org.mozilla.javascript.typedarrays.NativeArrayBufferViewarrayBuffer, byteLength, offset
 - 
Fields inherited from class org.mozilla.javascript.ScriptableObjectCONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 - 
Fields inherited from interface org.mozilla.javascript.ScriptableNOT_FOUND
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedNativeTypedArrayView()protectedNativeTypedArrayView(NativeArrayBuffer ab, int off, int len, int byteLen)
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(int i, T aByte)booleanadd(T aByte)booleanaddAll(int i, java.util.Collection<? extends T> bytes)booleanaddAll(java.util.Collection<? extends T> bytes)protected booleancheckIndex(int index)voidclear()protected abstract NativeTypedArrayView<T>construct(NativeArrayBuffer ab, int off, int len)booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> objects)voiddelete(int index)Removes the indexed property from the object.voiddelete(java.lang.String name)Removes a named property from the object.booleanequals(java.lang.Object o)java.lang.ObjectexecIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)'thisObj' will be null if invoked as constructor, in which case * instance of Scriptable should be returned.protected voidfillConstructorProperties(IdFunctionObject ctor)protected intfindInstanceIdInfo(java.lang.String s)Map name to id of instance property.protected intfindPrototypeId(java.lang.String s)protected intfindPrototypeId(Symbol k)java.lang.Objectget(int index, Scriptable start)Returns the value of the indexed property or NOT_FOUND.java.lang.Objectget(java.lang.String name, Scriptable start)Returns the value of the named property or NOT_FOUND.java.lang.ObjectgetArrayElement(int index)Return the element at the specified index.intgetArrayLength()Return the length of the array.abstract intgetBytesPerElement()Return the number of bytes represented by each element in the array.java.lang.Object[]getIds()Returns an array of ids for the properties of the object.protected java.lang.StringgetInstanceIdName(int id)Map id back to property name it defines.protected java.lang.ObjectgetInstanceIdValue(int id)Get id value.protected intgetMaxInstanceId()Get maximum id findInstanceIdInfo can generate.booleanhas(int index, Scriptable start)Returns true if the property index is defined.booleanhas(java.lang.String name, Scriptable start)Returns true if the named property is defined.inthashCode()intindexOf(java.lang.Object o)protected voidinitPrototypeId(int id)booleanisEmpty()java.util.Iterator<T>iterator()protected abstract java.lang.Objectjs_get(int index)protected abstract java.lang.Objectjs_set(int index, java.lang.Object c)intlastIndexOf(java.lang.Object o)java.util.ListIterator<T>listIterator()java.util.ListIterator<T>listIterator(int start)voidput(int index, Scriptable start, java.lang.Object val)Sets the value of the indexed property, creating it if need be.voidput(java.lang.String name, Scriptable start, java.lang.Object val)Sets the value of the named property, creating it if need be.protected abstract NativeTypedArrayView<T>realThis(Scriptable thisObj, IdFunctionObject f)Tremove(int i)booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> objects)booleanretainAll(java.util.Collection<?> objects)voidsetArrayElement(int index, java.lang.Object value)Set the element at the specified index.intsize()java.util.List<T>subList(int i, int i2)java.lang.Object[]toArray()<U> U[]toArray(U[] ts)- 
Methods inherited from class org.mozilla.javascript.typedarrays.NativeArrayBufferViewget, getBuffer, getByteLength, getByteOffset, isArg, useLittleEndian
 - 
Methods inherited from class org.mozilla.javascript.IdScriptableObjectactivatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, ensureType, exportAsJSClass, findInstanceIdInfo, getAttributes, getAttributes, getOwnPropertyDescriptor, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, setAttributes, setInstanceIdAttributes, setInstanceIdValue
 - 
Methods inherited from class org.mozilla.javascript.ScriptableObjectapplyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassName, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype
 
- 
 
- 
- 
- 
Field Detail- 
lengthprotected final int length The length, in elements, of the array
 - 
MAX_PROTOTYPE_IDprotected static final int MAX_PROTOTYPE_ID - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
NativeTypedArrayViewprotected NativeTypedArrayView() 
 - 
NativeTypedArrayViewprotected NativeTypedArrayView(NativeArrayBuffer ab, int off, int len, int byteLen) 
 
- 
 - 
Method Detail- 
getpublic java.lang.Object get(int index, Scriptable start)Description copied from class:ScriptableObjectReturns the value of the indexed property or NOT_FOUND.- Specified by:
- getin interface- Scriptable
- Overrides:
- getin class- ScriptableObject
- Parameters:
- index- the numeric index for the property
- start- the object in which the lookup began
- Returns:
- the value of the property (may be null), or NOT_FOUND
- See Also:
- Scriptable.get(String,Scriptable)
 
 - 
getpublic java.lang.Object get(java.lang.String name, Scriptable start)Description copied from class:ScriptableObjectReturns the value of the named property or NOT_FOUND.If the property was created using defineProperty, the appropriate getter method is called. - Specified by:
- getin interface- Scriptable
- Overrides:
- getin class- IdScriptableObject
- Parameters:
- name- the name of the property
- start- the object in which the lookup began
- Returns:
- the value of the property (may be null), or NOT_FOUND
- See Also:
- Context.getUndefinedValue()
 
 - 
haspublic boolean has(int index, Scriptable start)Description copied from class:ScriptableObjectReturns true if the property index is defined.- Specified by:
- hasin interface- Scriptable
- Overrides:
- hasin class- ScriptableObject
- Parameters:
- index- the numeric index for the property
- start- the object in which the lookup began
- Returns:
- true if and only if the property was found in the object
- See Also:
- Scriptable.get(int, Scriptable),- ScriptableObject.getProperty(Scriptable, int)
 
 - 
haspublic boolean has(java.lang.String name, Scriptable start)Description copied from class:ScriptableObjectReturns true if the named property is defined.- Specified by:
- hasin interface- Scriptable
- Overrides:
- hasin class- IdScriptableObject
- Parameters:
- name- the name of the property
- start- the object in which the lookup began
- Returns:
- true if and only if the property was found in the object
- See Also:
- Scriptable.get(String, Scriptable),- ScriptableObject.getProperty(Scriptable, String)
 
 - 
putpublic void put(int index, Scriptable start, java.lang.Object val)Description copied from class:ScriptableObjectSets the value of the indexed property, creating it if need be.- Specified by:
- putin interface- Scriptable
- Overrides:
- putin class- ScriptableObject
- Parameters:
- index- the numeric index for the property
- start- the object whose property is being set
- val- value to set the property to
- See Also:
- Scriptable.has(int, Scriptable),- Scriptable.get(int, Scriptable),- ScriptableObject.putProperty(Scriptable, int, Object),- Context.toObject(Object, Scriptable)
 
 - 
putpublic void put(java.lang.String name, Scriptable start, java.lang.Object val)Description copied from class:ScriptableObjectSets the value of the named property, creating it if need be.If 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. - Specified by:
- putin interface- Scriptable
- Overrides:
- putin class- IdScriptableObject
- Parameters:
- name- the name of the property
- start- the object whose property is being set
- val- value to set the property to
- See Also:
- Scriptable.has(String, Scriptable),- Scriptable.get(String, Scriptable),- ScriptableObject.putProperty(Scriptable, String, Object),- Context.toObject(Object, Scriptable)
 
 - 
deletepublic 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 interface- Scriptable
- Overrides:
- deletein class- ScriptableObject
- Parameters:
- index- the numeric index for the property
- See Also:
- Scriptable.get(int, Scriptable),- ScriptableObject.deleteProperty(Scriptable, int)
 
 - 
deletepublic void delete(java.lang.String name) Description copied from class:ScriptableObjectRemoves a named property from the object.If the property is not found, or it has the PERMANENT attribute, no action is taken. - Specified by:
- deletein interface- Scriptable
- Overrides:
- deletein class- IdScriptableObject
- Parameters:
- name- the name of the property
- See Also:
- Scriptable.get(String, Scriptable),- ScriptableObject.deleteProperty(Scriptable, String)
 
 - 
getIdspublic java.lang.Object[] 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 interface- Scriptable
- Overrides:
- getIdsin class- ScriptableObject
- 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.
 
 - 
checkIndexprotected boolean checkIndex(int index) 
 - 
getBytesPerElementpublic 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.
 - 
constructprotected abstract NativeTypedArrayView<T> construct(NativeArrayBuffer ab, int off, int len) 
 - 
js_getprotected abstract java.lang.Object js_get(int index) 
 - 
js_setprotected abstract java.lang.Object js_set(int index, java.lang.Object c)
 - 
realThisprotected abstract NativeTypedArrayView<T> realThis(Scriptable thisObj, IdFunctionObject f) 
 - 
execIdCallpublic java.lang.Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.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 interface- IdFunctionCall
- Overrides:
- execIdCallin class- IdScriptableObject
 
 - 
initPrototypeIdprotected void initPrototypeId(int id) - Overrides:
- initPrototypeIdin class- IdScriptableObject
 
 - 
findPrototypeIdprotected int findPrototypeId(Symbol k) - Overrides:
- findPrototypeIdin class- IdScriptableObject
 
 - 
findPrototypeIdprotected int findPrototypeId(java.lang.String s) - Overrides:
- findPrototypeIdin class- IdScriptableObject
 
 - 
fillConstructorPropertiesprotected void fillConstructorProperties(IdFunctionObject ctor) - Overrides:
- fillConstructorPropertiesin class- IdScriptableObject
 
 - 
getMaxInstanceIdprotected int getMaxInstanceId() Description copied from class:IdScriptableObjectGet maximum id findInstanceIdInfo can generate.- Overrides:
- getMaxInstanceIdin class- NativeArrayBufferView
 
 - 
getInstanceIdNameprotected java.lang.String getInstanceIdName(int id) Description copied from class:IdScriptableObjectMap id back to property name it defines.- Overrides:
- getInstanceIdNamein class- NativeArrayBufferView
 
 - 
getInstanceIdValueprotected java.lang.Object getInstanceIdValue(int id) Description copied from class:IdScriptableObjectGet id value. * If id value is constant, descendant can call cacheIdValue to store * value in the permanent cache. * Default implementation creates IdFunctionObject instance for given id * and cache its value- Overrides:
- getInstanceIdValuein class- NativeArrayBufferView
 
 - 
findInstanceIdInfoprotected int findInstanceIdInfo(java.lang.String s) Description copied from class:IdScriptableObjectMap name to id of instance property. Should return 0 if not found or the result ofIdScriptableObject.instanceIdInfo(int, int).- Overrides:
- findInstanceIdInfoin class- NativeArrayBufferView
 
 - 
getArrayElementpublic java.lang.Object getArrayElement(int index) 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 interface- ExternalArrayData
 
 - 
setArrayElementpublic void setArrayElement(int index, java.lang.Object value)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 interface- ExternalArrayData
 
 - 
getArrayLengthpublic int getArrayLength() Description copied from interface:ExternalArrayDataReturn the length of the array.- Specified by:
- getArrayLengthin interface- ExternalArrayData
 
 - 
containsAllpublic boolean containsAll(java.util.Collection<?> objects) 
 - 
indexOfpublic int indexOf(java.lang.Object o) - Specified by:
- indexOfin interface- java.util.List<T>
 
 - 
lastIndexOfpublic int lastIndexOf(java.lang.Object o) - Specified by:
- lastIndexOfin interface- java.util.List<T>
 
 - 
toArraypublic java.lang.Object[] toArray() 
 - 
toArraypublic <U> U[] toArray(U[] ts) 
 - 
sizepublic int size() - Specified by:
- sizein interface- java.util.Collection<T>
- Specified by:
- sizein interface- java.util.List<T>
- Overrides:
- sizein class- ScriptableObject
 
 - 
isEmptypublic boolean isEmpty() - Specified by:
- isEmptyin interface- java.util.Collection<T>
- Specified by:
- isEmptyin interface- java.util.List<T>
- Overrides:
- isEmptyin class- ScriptableObject
 
 - 
containspublic boolean contains(java.lang.Object o) 
 - 
equalspublic boolean equals(java.lang.Object o) 
 - 
hashCodepublic int hashCode() 
 - 
iteratorpublic java.util.Iterator<T> iterator() 
 - 
listIteratorpublic java.util.ListIterator<T> listIterator() - Specified by:
- listIteratorin interface- java.util.List<T>
 
 - 
listIteratorpublic java.util.ListIterator<T> listIterator(int start) - Specified by:
- listIteratorin interface- java.util.List<T>
 
 - 
subListpublic java.util.List<T> subList(int i, int i2) - Specified by:
- subListin interface- java.util.List<T>
 
 - 
addpublic boolean add(T aByte) 
 - 
addAllpublic boolean addAll(java.util.Collection<? extends T> bytes) 
 - 
addAllpublic boolean addAll(int i, java.util.Collection<? extends T> bytes)- Specified by:
- addAllin interface- java.util.List<T>
 
 - 
clearpublic void clear() 
 - 
removepublic boolean remove(java.lang.Object o) 
 - 
removeAllpublic boolean removeAll(java.util.Collection<?> objects) 
 
- 
 
-