Package me.topchetoeu.j2s.repl.buffers
Class TypedArrayValue
java.lang.Object
me.topchetoeu.j2s.runtime.values.Value
me.topchetoeu.j2s.runtime.values.objects.ObjectValue
me.topchetoeu.j2s.runtime.values.objects.ArrayLikeValue
me.topchetoeu.j2s.repl.buffers.TypedArrayValue
- Direct Known Subclasses:
Int32ArrayValue
,Int8ArrayValue
,Uint8ArrayValue
public abstract class TypedArrayValue
extends me.topchetoeu.j2s.runtime.values.objects.ArrayLikeValue
-
Nested Class Summary
Nested classes/interfaces inherited from class me.topchetoeu.j2s.runtime.values.objects.ObjectValue
me.topchetoeu.j2s.runtime.values.objects.ObjectValue.Property, me.topchetoeu.j2s.runtime.values.objects.ObjectValue.PrototypeProvider
Nested classes/interfaces inherited from class me.topchetoeu.j2s.runtime.values.Value
me.topchetoeu.j2s.runtime.values.Value.State
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal byte[]
final int
final int
final int
static final WeakHashMap<byte[],
me.topchetoeu.j2s.runtime.values.primitives.UserValue<byte[]>> Fields inherited from class me.topchetoeu.j2s.runtime.values.objects.ObjectValue
prototype
Fields inherited from class me.topchetoeu.j2s.runtime.values.Value
ARRAY_PROTO, BOOL_PROTO, ERROR_PROTO, FUNCTION_PROTO, GLOBAL, INT32_ARR_PROTO, INT8_ARR_PROTO, INTRINSICS, NULL, NUMBER_PROTO, OBJECT_PROTO, RANGE_ERR_PROTO, STRING_PROTO, SYMBOL_PROTO, SYNTAX_ERR_PROTO, TYPE_ERR_PROTO, UINT8_ARR_PROTO, UNDEFINED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic me.topchetoeu.j2s.runtime.values.primitives.UserValue<byte[]>
buffer
(byte[] buff, me.topchetoeu.j2s.runtime.values.objects.ObjectValue proto) me.topchetoeu.j2s.runtime.values.Value
get
(int i) boolean
has
(int i) protected abstract int
onGet
(int i) protected abstract void
onSet
(int i, int val) boolean
remove
(int i) boolean
set
(me.topchetoeu.j2s.common.Environment env, int i, me.topchetoeu.j2s.runtime.values.Value val) boolean
setSize
(int val) int
size()
Methods inherited from class me.topchetoeu.j2s.runtime.values.objects.ArrayLikeValue
defineOwnField, deleteOwnMember, getOwnMember, getOwnMembers, toArray, toReadableLines
Methods inherited from class me.topchetoeu.j2s.runtime.values.objects.ObjectValue
defineOwnProperty, freeze, getOwnSymbolMembers, getPrototype, getState, isPrimitive, preventExtensions, seal, setPrototype, setPrototype, setPrototype, toBoolean, toNumber, toPrimitive, toReadableLines, toString, type
Methods inherited from class me.topchetoeu.j2s.runtime.values.Value
add, and, apply, bitwiseNot, callWith, callWithAsync, construct, constructNoSelf, defineOwnField, defineOwnField, defineOwnField, defineOwnField, defineOwnField, defineOwnField, defineOwnField, defineOwnField, defineOwnField, defineOwnProperty, defineOwnProperty, defineOwnProperty, defineOwnProperty, deleteMember, deleteMember, deleteMember, deleteMember, deleteMember, deleteOwnMember, deleteOwnMember, deleteOwnMember, deleteOwnMember, divide, errorToReadable, fromIterator, getMember, getMember, getMember, getMember, getMember, getMemberDescriptor, getMemberOrNull, getMemberOrNull, getMemberOrNull, getMemberOrNull, getMemberOrNull, getMemberPath, getMemberPath, getMembers, getOwnMember, getOwnMember, getOwnMember, getOwnMember, getSymbolMembers, global, greater, greaterOrEqual, hasMember, hasMember, hasMember, hasMember, hasMember, intrinsics, isInstanceOf, isNaN, less, lessOrEqual, looseEqual, modulo, multiply, negative, or, setMember, setMember, setMember, setMember, setMember, setMemberIfExists, setMemberIfExists, setMemberIfExists, setMemberIfExists, setMemberIfExists, shiftLeft, shiftRight, subtract, toIterable, toReadable, unsignedShiftRight, xor
-
Field Details
-
userValues
public static final WeakHashMap<byte[],me.topchetoeu.j2s.runtime.values.primitives.UserValue<byte[]>> userValues -
buffer
public final byte[] buffer -
elementSize
public final int elementSize -
start
public final int start -
end
public final int end
-
-
Constructor Details
-
TypedArrayValue
public TypedArrayValue(byte[] buffer, int elementSize, int start, int end)
-
-
Method Details
-
onGet
protected abstract int onGet(int i) -
onSet
protected abstract void onSet(int i, int val) -
size
public int size()- Specified by:
size
in classme.topchetoeu.j2s.runtime.values.objects.ArrayLikeValue
-
setSize
public boolean setSize(int val) - Specified by:
setSize
in classme.topchetoeu.j2s.runtime.values.objects.ArrayLikeValue
-
get
public me.topchetoeu.j2s.runtime.values.Value get(int i) - Specified by:
get
in classme.topchetoeu.j2s.runtime.values.objects.ArrayLikeValue
-
set
public boolean set(me.topchetoeu.j2s.common.Environment env, int i, me.topchetoeu.j2s.runtime.values.Value val) - Specified by:
set
in classme.topchetoeu.j2s.runtime.values.objects.ArrayLikeValue
-
has
public boolean has(int i) - Specified by:
has
in classme.topchetoeu.j2s.runtime.values.objects.ArrayLikeValue
-
remove
public boolean remove(int i) - Specified by:
remove
in classme.topchetoeu.j2s.runtime.values.objects.ArrayLikeValue
-
buffer
public static me.topchetoeu.j2s.runtime.values.primitives.UserValue<byte[]> buffer(byte[] buff, me.topchetoeu.j2s.runtime.values.objects.ObjectValue proto)
-