Package io.github.eutro.wasm2j.embed
Interface Table
- All Superinterfaces:
ExternVal
- All Known Implementing Classes:
Table.AbstractArrayTable
,Table.ArrayTable
,Table.HandleTable
A table extern.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
A table with an array as the underlying representation.static class
A table which stores its elements as a table in itself.static class
A table which implements its methods by delegating to method handles. -
Method Summary
Modifier and TypeMethodDescription@Nullable Object
get
(int index) Get an element of the table.getType()
Get the type of this extern.default int
Grow the table by a number of elements, filling it with the given value.default void
Initialise the table with data.void
Set an element of the table.int
size()
Get the size of the table.Methods inherited from interface io.github.eutro.wasm2j.embed.ExternVal
getAsFunc, getAsGlobal, getAsHandle, getAsHandleRaw, getAsMemory, getAsTable, matchesType
-
Method Details
-
get
Get an element of the table.- Parameters:
index
- The index of the element to get.- Returns:
- The retrieved element.
-
set
Set an element of the table.- Parameters:
index
- The index of the element to set.value
- The value to set it to.
-
size
int size()Get the size of the table.- Returns:
- The size of the table.
-
init
Initialise the table with data.- Parameters:
dstIdx
- The index in the table to start at.srcIdx
- The index in the data array to start at.len
- The number of elements to copy.data
- The data array.
-
grow
Grow the table by a number of elements, filling it with the given value.This operation is allowed to fail (and must fail if the upper limit is exceeded), in which case -1 should be returned.
- Parameters:
growBy
- The number of elements to grow by.fillWith
- The value to fill new elements with.- Returns:
- The old size of the table.
-
getType
Description copied from interface:ExternVal
Get the type of this extern.
-