public abstract class NativeTypedArrayView<T> extends NativeArrayBufferView implements java.util.List<T>, java.util.RandomAccess, ExternalArrayData
ScriptableObject.KeyComparator
Modifier and Type | Field and Description |
---|---|
protected int |
length
The length, in elements, of the array
|
protected static int |
MAX_PROTOTYPE_ID |
arrayBuffer, byteLength, offset
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
NOT_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(java.util.Collection<? extends T> bytes) |
boolean |
addAll(int i,
java.util.Collection<? extends T> bytes) |
protected boolean |
checkIndex(int index) |
void |
clear() |
protected abstract NativeTypedArrayView<T> |
construct(NativeArrayBuffer ab,
int off,
int len) |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> objects) |
void |
delete(int index)
Removes the indexed property from the object.
|
boolean |
equals(java.lang.Object o) |
java.lang.Object |
execIdCall(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 void |
fillConstructorProperties(IdFunctionObject ctor) |
protected int |
findInstanceIdInfo(java.lang.String s)
Map name to id of instance property.
|
protected int |
findPrototypeId(java.lang.String s) |
protected int |
findPrototypeId(Symbol k) |
java.lang.Object |
get(int index,
Scriptable start)
Returns the value of the indexed property or NOT_FOUND.
|
java.lang.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.
|
java.lang.Object[] |
getIds()
Returns an array of ids for the properties of the object.
|
protected java.lang.String |
getInstanceIdName(int id)
Map id back to property name it defines.
|
protected java.lang.Object |
getInstanceIdValue(int id)
Get id value.
|
protected int |
getMaxInstanceId()
Get maximum id findInstanceIdInfo can generate.
|
boolean |
has(int index,
Scriptable start)
Returns true if the property index is defined.
|
int |
hashCode() |
int |
indexOf(java.lang.Object o) |
protected void |
initPrototypeId(int id) |
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
protected abstract java.lang.Object |
js_get(int index) |
protected abstract java.lang.Object |
js_set(int index,
java.lang.Object c) |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<T> |
listIterator() |
java.util.ListIterator<T> |
listIterator(int start) |
void |
put(int index,
Scriptable start,
java.lang.Object val)
Sets the value of the indexed property, creating it if need be.
|
protected abstract NativeTypedArrayView<T> |
realThis(Scriptable thisObj,
IdFunctionObject f) |
T |
remove(int i) |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> objects) |
boolean |
retainAll(java.util.Collection<?> objects) |
void |
setArrayElement(int index,
java.lang.Object value)
Set the element at the specified index.
|
int |
size() |
java.util.List<T> |
subList(int i,
int i2) |
java.lang.Object[] |
toArray() |
<U> U[] |
toArray(U[] ts) |
getBuffer, getByteLength, getByteOffset, isArg, useLittleEndian
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, delete, exportAsJSClass, findInstanceIdInfo, get, get, getAttributes, getAttributes, getOwnPropertyDescriptor, has, has, hasPrototypeMap, incompatibleCallError, initPrototypeConstructor, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, put, setAttributes, setInstanceIdAttributes, setInstanceIdValue
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, 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, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, putConst, putConstProperty, putProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype
protected final int length
protected static final int MAX_PROTOTYPE_ID
protected NativeTypedArrayView()
protected NativeTypedArrayView(NativeArrayBuffer ab, int off, int len, int byteLen)
public java.lang.Object get(int index, Scriptable start)
ScriptableObject
get
in interface Scriptable
get
in class ScriptableObject
index
- the numeric index for the propertystart
- the object in which the lookup beganScriptable.get(String,Scriptable)
public boolean has(int index, Scriptable start)
ScriptableObject
has
in interface Scriptable
has
in class ScriptableObject
index
- the numeric index for the propertystart
- the object in which the lookup beganScriptable.get(int, Scriptable)
,
ScriptableObject.getProperty(Scriptable, int)
public void put(int index, Scriptable start, java.lang.Object val)
ScriptableObject
put
in interface Scriptable
put
in class ScriptableObject
index
- 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 delete(int index)
ScriptableObject
delete
in interface Scriptable
delete
in class ScriptableObject
index
- the numeric index for the propertyScriptable.get(int, Scriptable)
,
ScriptableObject.deleteProperty(Scriptable, int)
public java.lang.Object[] getIds()
ScriptableObject
Any properties with the attribute DONTENUM are not listed.
getIds
in interface Scriptable
getIds
in class ScriptableObject
protected boolean checkIndex(int index)
public abstract int getBytesPerElement()
protected abstract NativeTypedArrayView<T> construct(NativeArrayBuffer ab, int off, int len)
protected abstract java.lang.Object js_get(int index)
protected abstract java.lang.Object js_set(int index, java.lang.Object c)
protected abstract NativeTypedArrayView<T> realThis(Scriptable thisObj, IdFunctionObject f)
public java.lang.Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
IdScriptableObject
execIdCall
in interface IdFunctionCall
execIdCall
in class IdScriptableObject
protected void initPrototypeId(int id)
initPrototypeId
in class IdScriptableObject
protected int findPrototypeId(Symbol k)
findPrototypeId
in class IdScriptableObject
protected int findPrototypeId(java.lang.String s)
findPrototypeId
in class IdScriptableObject
protected void fillConstructorProperties(IdFunctionObject ctor)
fillConstructorProperties
in class IdScriptableObject
protected int getMaxInstanceId()
IdScriptableObject
getMaxInstanceId
in class NativeArrayBufferView
protected java.lang.String getInstanceIdName(int id)
IdScriptableObject
getInstanceIdName
in class NativeArrayBufferView
protected java.lang.Object getInstanceIdValue(int id)
IdScriptableObject
getInstanceIdValue
in class NativeArrayBufferView
protected int findInstanceIdInfo(java.lang.String s)
IdScriptableObject
IdScriptableObject.instanceIdInfo(int, int)
.findInstanceIdInfo
in class NativeArrayBufferView
public java.lang.Object getArrayElement(int index)
ExternalArrayData
getArrayElement
in interface ExternalArrayData
public void setArrayElement(int index, java.lang.Object value)
ExternalArrayData
setArrayElement
in interface ExternalArrayData
public int getArrayLength()
ExternalArrayData
getArrayLength
in interface ExternalArrayData
public boolean containsAll(java.util.Collection<?> objects)
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List<T>
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List<T>
public java.lang.Object[] toArray()
public <U> U[] toArray(U[] ts)
public int size()
size
in interface java.util.Collection<T>
size
in interface java.util.List<T>
size
in class ScriptableObject
public boolean isEmpty()
isEmpty
in interface java.util.Collection<T>
isEmpty
in interface java.util.List<T>
isEmpty
in class ScriptableObject
public boolean contains(java.lang.Object o)
public boolean equals(java.lang.Object o)
public int hashCode()
public java.util.Iterator<T> iterator()
public java.util.ListIterator<T> listIterator()
listIterator
in interface java.util.List<T>
public java.util.ListIterator<T> listIterator(int start)
listIterator
in interface java.util.List<T>
public java.util.List<T> subList(int i, int i2)
subList
in interface java.util.List<T>
public boolean add(T aByte)
public boolean addAll(java.util.Collection<? extends T> bytes)
public boolean addAll(int i, java.util.Collection<? extends T> bytes)
addAll
in interface java.util.List<T>
public void clear()
public boolean remove(java.lang.Object o)
public boolean removeAll(java.util.Collection<?> objects)