com.gargoylesoftware.htmlunit.javascript.host.arrays
Class ArrayBufferViewBase

java.lang.Object
  extended by net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
      extended by com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
          extended by com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBufferView
              extended by com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBufferViewBase
All Implemented Interfaces:
Serializable, Cloneable, net.sourceforge.htmlunit.corejs.javascript.ConstProperties, net.sourceforge.htmlunit.corejs.javascript.debug.DebuggableObject, net.sourceforge.htmlunit.corejs.javascript.Scriptable
Direct Known Subclasses:
Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray

public class ArrayBufferViewBase
extends ArrayBufferView

The parent class of all typed arrays, DataView is not included.

Version:
$Revision: 7517 $
Author:
Ahmed Ashour
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
ArrayBufferViewBase()
           
 
Method Summary
 void constructor(Object object, Object byteOffset, Object length)
          The constructor.
protected  Number fromArray(byte[] array, int offset)
          Converts the provided byte array to number.
 Number get(int index, net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
          
protected  int getBytesPerElement()
          Returns the size in bytes of an item in this array.
 int getLength()
          Returns the number of entries in the array.
 void put(int index, net.sourceforge.htmlunit.corejs.javascript.Scriptable start, Object value)
          
 void set(net.sourceforge.htmlunit.corejs.javascript.ScriptableObject sourceArray, int offset)
          Sets multiple values in the typed array, reading input values from a specified array.
 ArrayBufferView subarray(int begin, Object end)
          Returns a new view on the ArrayBuffer store for this object.
protected  byte[] toArray(Number number)
          Converts the provided number to byte array.
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBufferView
constructor, getBuffer, getByteLength, getByteOffset, setBuffer, setByteLength
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
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, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayBufferViewBase

public ArrayBufferViewBase()
Method Detail

constructor

public void constructor(Object object,
                        Object byteOffset,
                        Object length)
The constructor.

Parameters:
object - the object
byteOffset - optional byteOffset
length - optional length

getLength

public int getLength()
Returns the number of entries in the array.

Returns:
the number of entries

set

public void set(net.sourceforge.htmlunit.corejs.javascript.ScriptableObject sourceArray,
                int offset)
Sets multiple values in the typed array, reading input values from a specified array.

Parameters:
sourceArray - the source array
offset - the offset into the target array at which to begin writing values from the source one

get

public Number get(int index,
                  net.sourceforge.htmlunit.corejs.javascript.Scriptable start)

Specified by:
get in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
Overrides:
get in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject

put

public void put(int index,
                net.sourceforge.htmlunit.corejs.javascript.Scriptable start,
                Object value)

Specified by:
put in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
Overrides:
put in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject

toArray

protected byte[] toArray(Number number)
Converts the provided number to byte array.

Parameters:
number - the number
Returns:
the byte array

fromArray

protected Number fromArray(byte[] array,
                           int offset)
Converts the provided byte array to number.

Parameters:
array - the array
offset - the offset
Returns:
the byte array

subarray

public ArrayBufferView subarray(int begin,
                                Object end)
Returns a new view on the ArrayBuffer store for this object.

Parameters:
begin - the offset to the first element in the array to be referenced by the new object
end - the end offset (exclusive), optional to return at the end.
Returns:
the newly created array

getBytesPerElement

protected int getBytesPerElement()
Returns the size in bytes of an item in this array.

Returns:
the size of bytes of an item


Copyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.