Class Value
- All Implemented Interfaces:
Proxy
JSCContext. The JSCValue
protects the referenced value from being garbage collected.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classValue.Builder<B extends Value.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionValue()Creates a new Value.Value(MemorySegment address) Create a Value proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionstatic ValueCreate a newJSCValuereferencing an array with the given items.static ValuearrayBuffer(Context context, @Nullable MemorySegment data, long size) Creates a newArrayBufferfrom existingdatain memory.byte[]Gets a pointer to memory that contains the array buffer data.longGets the size in bytes of the array buffer.static ValuearrayFromGarray(Context context, @Nullable Value @Nullable [] array) Create a newJSCValuereferencing an array with the items fromarray.Ifarrayisnullor empty a new empty array will be created.static ValuearrayFromStrv(Context context, @Nullable String @Nullable [] strv) Create a newJSCValuereferencing an array of strings with the items fromstrv.Ifarrayisnullor empty a new empty array will be created.protected ValueasParent()Returns this instance as if it were its parent type.static ValueCreate a newJSCValuefromvaluestatic Value.Builder<? extends Value.Builder> builder()AValue.Builderobject constructs aValuewith the specified properties.constructorCall(@Nullable Value @Nullable [] parameters) Invoke <function>new</function> with constructor referenced byvalue.IfnParametersis 0 no parameters will be passed to the constructor.static ValueCreate a newJSCValuereferencing a new value created by parsingjson.static Valuefunction(Context context, @Nullable String name, @Nullable Callback callback, Type returnType, @Nullable Type @Nullable [] parameterTypes) Create a function incontext.Ifnameisnullan anonymous function will be created.functionCall(@Nullable Value @Nullable [] parameters) Call function referenced byvalue,passing the givenparameters.IfnParametersis 0 no parameters will be passed to the function.static ValuefunctionVariadic(Context context, @Nullable String name, @Nullable Callback callback, Type returnType) Create a function incontext.Ifnameisnullan anonymous function will be created.Get theJSCContextin which this Value was created.static @Nullable TypegetType()Get the GType of the Value classbooleanisArray()Get whether the value referenced by this Value is an array.booleanCheck whether the this Value is anArrayBuffer.booleanGet whether the value referenced by this Value is a boolean.booleanGet whether the value referenced by this Value is a constructor.booleanGet whether the value referenced by this Value is a functionbooleanisNull()Get whether the value referenced by this Value is <function>null</function>.booleanisNumber()Get whether the value referenced by this Value is a number.booleanisObject()Get whether the value referenced by this Value is an object.booleanisString()Get whether the value referenced by this Value is a stringbooleanDetermines whether a value is a typed array.booleanGet whether the value referenced by this Value is <function>undefined</function>.newTypedArrayWithBuffer(TypedArrayType type, long offset, long length) Create a new typed array value with elements from an array buffer.static ValueCreate a newJSCValuereferencing <function>null</function> incontext.static ValueCreate a newJSCValuefromnumber.static Valueobject(Context context, @Nullable MemorySegment instance, @Nullable Class jscClass) Create a newJSCValuefrominstance.Ifinstanceisnulla new empty object is created.voidobjectDefinePropertyAccessor(String propertyName, Set<ValuePropertyFlags> flags, Type propertyType, @Nullable Callback getter, @Nullable Callback setter) Define or modify a property withpropertyNamein object referenced byvalue.When the property value needs to be getted or set,getterandsettercallbacks will be called.voidobjectDefinePropertyAccessor(String propertyName, ValuePropertyFlags flags, Type propertyType, @Nullable Callback getter, @Nullable Callback setter) Define or modify a property withpropertyNamein object referenced byvalue.When the property value needs to be getted or set,getterandsettercallbacks will be called.voidobjectDefinePropertyData(String propertyName, Set<ValuePropertyFlags> flags, @Nullable Value propertyValue) Define or modify a property withpropertyNamein object referenced byvalue.This is equivalent to JavaScript <function>Object.defineProperty()</function> when used with a data descriptor.voidobjectDefinePropertyData(String propertyName, ValuePropertyFlags flags, @Nullable Value propertyValue) Define or modify a property withpropertyNamein object referenced byvalue.This is equivalent to JavaScript <function>Object.defineProperty()</function> when used with a data descriptor.booleanobjectDeleteProperty(String name) Try to delete property withnamefromvalue.This function will returnfalseif the property was defined withoutValuePropertyFlags.CONFIGURABLEflag.@Nullable String @Nullable []Get the list of property names ofvalue.Only properties defined withValuePropertyFlags.ENUMERABLEflag will be collected.objectGetProperty(String name) Get property withnamefromvalue.objectGetPropertyAtIndex(int index) Get property atindexfromvalue.booleanobjectHasProperty(String name) Get whether this Value has property withname.objectInvokeMethod(String name, @Nullable Value @Nullable [] parameters) Invoke method withnameon object referenced byvalue,passing the givenparameters.IfnParametersis 0 no parameters will be passed to the method.booleanobjectIsInstanceOf(String name) Get whether the value referenced by this Value is an instance of classname.voidobjectSetProperty(String name, Value property) Setpropertywithnameonvalue.voidobjectSetPropertyAtIndex(int index, Value property) Setpropertyatindexonvalue.static ValueCreates a new Promise.static ValueCreate a newJSCValuefromstring.If you need to create aJSCValuefrom a string containing null characters, use jsc_value_new_string_from_bytes() instead.static ValuestringFromBytes(Context context, byte @Nullable [] bytes) Create a newJSCValuefrombytes.booleanConvert this Value to a boolean.doubletoDouble()Convert this Value to a double.inttoInt32()Convert this Value to agint32.toJson(int indent) Create a JSON string of this Value serialization.toString()Convert this Value to a string.byte[]Convert this Value to a string and return the results asGBytes.static ValuetypedArray(Context context, TypedArrayType type, long length) Create a new typed array containing a given amount of elements.Obtain theArrayBufferfor the memory region of the typed array elements.@Nullable MemorySegmenttypedArrayGetData(@Nullable Out<Long> length) Obtains a pointer to the memory region that holds the elements of the typed array; modifications done to them will be visible to JavaScript code.longGets the number of elements in a typed array.longGets the offset over the underlying array buffer data.longGets the size of a typed array.Gets the type of elements contained in a typed array.static ValueCreate a newJSCValuereferencing <function>undefined</function> incontext.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Value
Create a Value proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
Value
public Value()Creates a new Value.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName(). This will call the native function pointer of this virtual method in the typeclass of the parent type. -
array
Create a newJSCValuereferencing an array with the given items. IffirstItemTypeisG_TYPE_NONEan empty array is created.- Parameters:
context- aJSCContextfirstItemType-GTypeof first item, orG_TYPE_NONEvarargs- value of the first item, followed optionally by more type/value pairs, followed byG_TYPE_NONE.- Returns:
- a
JSCValue.
-
arrayBuffer
Creates a newArrayBufferfrom existingdatain memory.The
datais not copied: while this allows sharing data with JavaScript efficiently, the caller must ensure that the memory region remains valid until the newly created object is released by JSC.Optionally, a
destroyNotifycallback can be provided, which will be invoked withuserDataas parameter when theArrayBufferobject is released. This is intended to be used for freeing resources related to the memory region which contains the data:GMappedFile *f = g_mapped_file_new (file_path, TRUE, NULL); JSCValue *value = jsc_value_new_array_buffer (context, g_mapped_file_get_contents (f), g_mapped_file_get_length (f), (GDestroyNotify) g_mapped_file_unref, f);Note that the
userDatacan be the same value asdata:void *bytes = g_malloc0 (100); JSCValue *value = jsc_value_new_array_buffer (context, bytes, 100, g_free, bytes);- Parameters:
context- AJSCContextdata- Pointer to a region of memory.size- Size in bytes of the memory region.- Returns:
- A
JSCValue, ornullin case of exception. - Since:
- 2.38
-
arrayFromGarray
Create a newJSCValuereferencing an array with the items fromarray.Ifarrayisnullor empty a new empty array will be created. Elements ofarrayshould be pointers to aJSCValue.- Parameters:
context- aJSCContextarray- aGPtrArray- Returns:
- a
JSCValue.
-
arrayFromStrv
Create a newJSCValuereferencing an array of strings with the items fromstrv.Ifarrayisnullor empty a new empty array will be created.- Parameters:
context- aJSCContextstrv- anull-terminated array of strings- Returns:
- a
JSCValue.
-
boolean_
-
fromJson
-
functionVariadic
public static Value functionVariadic(Context context, @Nullable String name, @Nullable Callback callback, Type returnType) Create a function incontext.Ifnameisnullan anonymous function will be created. When the function is called by JavaScript or jsc_value_function_call(),callbackis called receiving anGPtrArrayofJSCValue<!-- -->s with the arguments and thenuserDataas last parameter. When the function is cleared incontext,destroyNotifyis called withuserDataas parameter.Note that the value returned by
callbackmust be fully transferred. In case of boxed types, you could useG_TYPE_POINTERinstead of the actual boxedGTypeto ensure that the instance owned byJSCClassis used. If you really want to return a new copy of the boxed type, useJSC_TYPE_VALUEand return aJSCValuecreated with jsc_value_new_object() that receives the copy as instance parameter.- Parameters:
context- aJSCContextname- the function name ornullcallback- aGCallback.returnType- theGTypeof the function return value, orG_TYPE_NONEif the function is void.- Returns:
- a
JSCValue.
-
function
public static Value function(Context context, @Nullable String name, @Nullable Callback callback, Type returnType, @Nullable Type @Nullable [] parameterTypes) Create a function incontext.Ifnameisnullan anonymous function will be created. When the function is called by JavaScript or jsc_value_function_call(),callbackis called receiving the function parameters and thenuserDataas last parameter. When the function is cleared incontext,destroyNotifyis called withuserDataas parameter.Note that the value returned by
callbackmust be fully transferred. In case of boxed types, you could useG_TYPE_POINTERinstead of the actual boxedGTypeto ensure that the instance owned byJSCClassis used. If you really want to return a new copy of the boxed type, useJSC_TYPE_VALUEand return aJSCValuecreated with jsc_value_new_object() that receives the copy as instance parameter.- Parameters:
context- aJSCContextname- the function name ornullcallback- aGCallback.returnType- theGTypeof the function return value, orG_TYPE_NONEif the function is void.parameterTypes- a list ofGType<!-- -->s, one for each parameter, ornull- Returns:
- a
JSCValue.
-
null_
-
number
-
object
public static Value object(Context context, @Nullable MemorySegment instance, @Nullable Class jscClass) Create a newJSCValuefrominstance.Ifinstanceisnulla new empty object is created. Wheninstanceis provided,jscClassmust be provided too.jscClasstakes ownership ofinstancethat will be freed by theGDestroyNotifypassed to jsc_context_register_class().- Parameters:
context- aJSCContextinstance- an object instance ornulljscClass- theJSCClassofinstance- Returns:
- a
JSCValue.
-
promise
Creates a new Promise.executorwill be invoked during promise initialization and it receives theresolveandrejectobjects than can be called to resolve or reject the promise. It is called like a JavaScript function, so exceptions raised during the executor invocation will not be propagated to the context, but handled by the promise causing a rejection.- Parameters:
context- aJSCContextexecutor- an initialization callback- Returns:
- a deferred promise object
- Since:
- 2.48
-
string
Create a newJSCValuefromstring.If you need to create aJSCValuefrom a string containing null characters, use jsc_value_new_string_from_bytes() instead.- Parameters:
context- aJSCContextstring- a null-terminated string- Returns:
- a
JSCValue.
-
stringFromBytes
-
typedArray
Create a new typed array containing a given amount of elements.Create a
JSCValuereferencing a new typed array with space forlengthelements of a giventype.As all typed arrays must have an associatedArrayBuffer, a new one of suitable size will be allocated to store the elements, which will be initialized to zero.The
typemust not beTypedArrayType.NONE.- Parameters:
context- aJSCContexttype- the type of array elementslength- number of elements in the array- Returns:
- a
JSCValue - Since:
- 2.38
-
undefined
-
arrayBufferGetData
public byte[] arrayBufferGetData()Gets a pointer to memory that contains the array buffer data.Obtains a pointer to the memory region that holds the contents of the
ArrayBuffer; modifications done to the data will be visible to JavaScript code. Ifsizeis notnull, the size in bytes of the memory region will also be stored in the pointed location.Note that the pointer returned by this function is not guaranteed to remain the same after calls to other JSC API functions. If you plan to access the data of the
ArrayBufferlater, you can keep a reference to the this Value and obtain the data pointer at a later point. Keep in mind that if JavaScript code has a chance to run, for example due to main loop events that result in JSC being called, the contents of the memory region might be modified in the meantime. Consider taking a copy of the data and using the copy instead in asynchronous code.- Returns:
- pointer to memory.
- Since:
- 2.38
-
arrayBufferGetSize
public long arrayBufferGetSize()Gets the size in bytes of the array buffer.Obtains the size in bytes of the memory region that holds the contents of an
ArrayBuffer.- Returns:
- size, in bytes.
- Since:
- 2.38
-
constructorCall
Invoke <function>new</function> with constructor referenced byvalue.IfnParametersis 0 no parameters will be passed to the constructor.- Parameters:
parameters- theJSCValue<!-- -->s to pass as parameters to the constructor, ornull- Returns:
- a
JSCValuereferencing the newly created object instance.
-
functionCall
Call function referenced byvalue,passing the givenparameters.IfnParametersis 0 no parameters will be passed to the function.This function always returns a
JSCValue, in case of void functions aJSCValuereferencing <function>undefined</function> is returned- Parameters:
parameters- theJSCValue<!-- -->s to pass as parameters to the function, ornull- Returns:
- a
JSCValuewith the return value of the function.
-
getContext
Get theJSCContextin which this Value was created.- Returns:
- the
JSCValuecontext.
-
isArray
public boolean isArray()Get whether the value referenced by this Value is an array.- Returns:
- whether the value is an array.
-
isArrayBuffer
public boolean isArrayBuffer()Check whether the this Value is anArrayBuffer.- Returns:
- whether the value is an
ArrayBuffer - Since:
- 2.38
-
isBoolean
public boolean isBoolean()Get whether the value referenced by this Value is a boolean.- Returns:
- whether the value is a boolean.
-
isConstructor
public boolean isConstructor()Get whether the value referenced by this Value is a constructor.- Returns:
- whether the value is a constructor.
-
isFunction
public boolean isFunction()Get whether the value referenced by this Value is a function- Returns:
- whether the value is a function.
-
isNull
public boolean isNull()Get whether the value referenced by this Value is <function>null</function>.- Returns:
- whether the value is null.
-
isNumber
public boolean isNumber()Get whether the value referenced by this Value is a number.- Returns:
- whether the value is a number.
-
isObject
public boolean isObject()Get whether the value referenced by this Value is an object.- Returns:
- whether the value is an object.
-
isString
public boolean isString()Get whether the value referenced by this Value is a string- Returns:
- whether the value is a string
-
isTypedArray
public boolean isTypedArray()Determines whether a value is a typed array.- Returns:
- Whether this Value is a typed array.
- Since:
- 2.38
-
isUndefined
public boolean isUndefined()Get whether the value referenced by this Value is <function>undefined</function>.- Returns:
- whether the value is undefined.
-
newTypedArrayWithBuffer
Create a new typed array value with elements from an array buffer.Create a
JSCValuereferencing a new typed array value containing elements of the giventype,where the elements are stored at the memory region represented by thearrayBuffer.The
typemust not beTypedArrayType.NONE.The
offsetandlengthparameters can be used to indicate which part of the array buffer can be accessed through the typed array. If both are omitted (passing zero asoffset,and-1aslength),the whole this Value is exposed through the typed array. Omitting thelengthwith a non-zerooffsetwill expose the remainder of the this Value starting at the indicated offset.- Parameters:
type- type of array elements.offset- offset, in bytes.length- number of array elements, or-1.- Returns:
- a
JSCValue - Since:
- 2.38
-
objectDefinePropertyAccessor
public void objectDefinePropertyAccessor(String propertyName, Set<ValuePropertyFlags> flags, Type propertyType, @Nullable Callback getter, @Nullable Callback setter) Define or modify a property withpropertyNamein object referenced byvalue.When the property value needs to be getted or set,getterandsettercallbacks will be called. When the property is cleared in theJSCClasscontext,destroyNotifyis called withuserDataas parameter. This is equivalent to JavaScript <function>Object.defineProperty()</function> when used with an accessor descriptor.Note that the value returned by
gettermust be fully transferred. In case of boxed types, you could useG_TYPE_POINTERinstead of the actual boxedGTypeto ensure that the instance owned byJSCClassis used. If you really want to return a new copy of the boxed type, useJSC_TYPE_VALUEand return aJSCValuecreated with jsc_value_new_object() that receives the copy as instance parameter.Note that
getterandsetterare called as functions and not methods, so they don't receive an instance as first parameter. Use jsc_class_add_property() if you want to add property accessor invoked as a method.- Parameters:
propertyName- the name of the property to defineflags-JSCValuePropertyFlagspropertyType- theGTypeof the propertygetter- aGCallbackto be called to get the property valuesetter- aGCallbackto be called to set the property value
-
objectDefinePropertyAccessor
public void objectDefinePropertyAccessor(String propertyName, ValuePropertyFlags flags, Type propertyType, @Nullable Callback getter, @Nullable Callback setter) Define or modify a property withpropertyNamein object referenced byvalue.When the property value needs to be getted or set,getterandsettercallbacks will be called. When the property is cleared in theJSCClasscontext,destroyNotifyis called withuserDataas parameter. This is equivalent to JavaScript <function>Object.defineProperty()</function> when used with an accessor descriptor.Note that the value returned by
gettermust be fully transferred. In case of boxed types, you could useG_TYPE_POINTERinstead of the actual boxedGTypeto ensure that the instance owned byJSCClassis used. If you really want to return a new copy of the boxed type, useJSC_TYPE_VALUEand return aJSCValuecreated with jsc_value_new_object() that receives the copy as instance parameter.Note that
getterandsetterare called as functions and not methods, so they don't receive an instance as first parameter. Use jsc_class_add_property() if you want to add property accessor invoked as a method.- Parameters:
propertyName- the name of the property to defineflags-JSCValuePropertyFlagspropertyType- theGTypeof the propertygetter- aGCallbackto be called to get the property valuesetter- aGCallbackto be called to set the property value
-
objectDefinePropertyData
public void objectDefinePropertyData(String propertyName, Set<ValuePropertyFlags> flags, @Nullable Value propertyValue) Define or modify a property withpropertyNamein object referenced byvalue.This is equivalent to JavaScript <function>Object.defineProperty()</function> when used with a data descriptor.- Parameters:
propertyName- the name of the property to defineflags-JSCValuePropertyFlagspropertyValue- the default property value
-
objectDefinePropertyData
public void objectDefinePropertyData(String propertyName, ValuePropertyFlags flags, @Nullable Value propertyValue) Define or modify a property withpropertyNamein object referenced byvalue.This is equivalent to JavaScript <function>Object.defineProperty()</function> when used with a data descriptor.- Parameters:
propertyName- the name of the property to defineflags-JSCValuePropertyFlagspropertyValue- the default property value
-
objectDeleteProperty
Try to delete property withnamefromvalue.This function will returnfalseif the property was defined withoutValuePropertyFlags.CONFIGURABLEflag.- Parameters:
name- the property name- Returns:
trueif the property was deleted, orfalseotherwise.
-
objectEnumerateProperties
Get the list of property names ofvalue.Only properties defined withValuePropertyFlags.ENUMERABLEflag will be collected.- Returns:
- a
null-terminated array of strings containing the property names, ornullif this Value doesn't have enumerable properties. Use g_strfreev() to free.
-
objectGetProperty
-
objectGetPropertyAtIndex
Get property atindexfromvalue.- Parameters:
index- the property index- Returns:
- the property
JSCValue.
-
objectHasProperty
Get whether this Value has property withname.- Parameters:
name- the property name- Returns:
trueif this Value has a property withname,orfalseotherwise
-
objectInvokeMethod
Invoke method withnameon object referenced byvalue,passing the givenparameters.IfnParametersis 0 no parameters will be passed to the method. The object instance will be handled automatically even when the method is a custom one registered with jsc_class_add_method(), so it should never be passed explicitly as parameter of this function.This function always returns a
JSCValue, in case of void methods aJSCValuereferencing <function>undefined</function> is returned.- Parameters:
name- the method nameparameters- theJSCValue<!-- -->s to pass as parameters to the method, ornull- Returns:
- a
JSCValuewith the return value of the method.
-
objectIsInstanceOf
Get whether the value referenced by this Value is an instance of classname.- Parameters:
name- a class name- Returns:
- whether the value is an object instance of class
name.
-
objectSetProperty
-
objectSetPropertyAtIndex
Setpropertyatindexonvalue.- Parameters:
index- the property indexproperty- theJSCValueto set
-
toBoolean
public boolean toBoolean()Convert this Value to a boolean.- Returns:
- a
gbooleanresult of the conversion.
-
toDouble
public double toDouble()Convert this Value to a double.- Returns:
- a
gdoubleresult of the conversion.
-
toInt32
public int toInt32()Convert this Value to agint32.- Returns:
- a
gint32result of the conversion.
-
toJson
Create a JSON string of this Value serialization. Ifindentis 0, the resulting JSON will not contain newlines. The size of the indent is clamped to 10 spaces.- Parameters:
indent- The number of spaces to indent when nesting.- Returns:
- a null-terminated JSON string with serialization of this Value
- Since:
- 2.28
-
toString
-
toStringAsBytes
public byte[] toStringAsBytes()Convert this Value to a string and return the results asGBytes. This is needed to handle strings with null characters.- Returns:
- a
GByteswith the result of the conversion.
-
typedArrayGetBuffer
Obtain theArrayBufferfor the memory region of the typed array elements.- Returns:
- A
JSCValue - Since:
- 2.38
-
typedArrayGetData
Obtains a pointer to the memory region that holds the elements of the typed array; modifications done to them will be visible to JavaScript code. Iflengthis notnull, the number of elements contained in the typed array are also stored in the pointed location.The returned pointer needs to be casted to the appropriate type (see
JSCTypedArrayType), and has theoffsetover the underlying array buffer data applied—that is, points to the first element of the typed array:if (jsc_value_typed_array_get_type(value) != JSC_TYPED_ARRAY_UINT32) g_error ("Only arrays of uint32_t are supported"); gsize count = 0; uint32_t *elements = jsc_value_typed_array_get_contents (value, &count); for (gsize i = 0; i < count; i++) g_print ("index %zu, value %" PRIu32 "\\n", i, elements[i]);Note that the pointer returned by this function is not guaranteed to remain the same after calls to other JSC API functions. See jsc_value_array_buffer_get_data() for details.
- Parameters:
length- location to return the number of elements contained- Returns:
- pointer to memory.
- Since:
- 2.38
-
typedArrayGetLength
public long typedArrayGetLength()Gets the number of elements in a typed array.- Returns:
- number of elements.
- Since:
- 2.38
-
typedArrayGetOffset
public long typedArrayGetOffset()Gets the offset over the underlying array buffer data.- Returns:
- offset, in bytes.
- Since:
- 2.38
-
typedArrayGetSize
public long typedArrayGetSize()Gets the size of a typed array.- Returns:
- size, in bytes.
- Since:
- 2.38
-
typedArrayGetType
Gets the type of elements contained in a typed array.- Returns:
- type of the elements, or
TypedArrayType.NONEif this Value is not a typed array. - Since:
- 2.38
-
builder
AValue.Builderobject constructs aValuewith the specified properties. Use the variousset...()methods to set properties, and finish construction withValue.Builder.build().- Returns:
- the builder object
-