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
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA table with an array as the underlying representation.static classA table which stores its elements as a table in itself.static classA table which implements its methods by delegating to method handles. -
Method Summary
Modifier and TypeMethodDescription@Nullable Objectget(int index) Get an element of the table.getType()Get the type of this extern.default intGrow the table by a number of elements, filling it with the given value.default voidInitialise the table with data.voidSet an element of the table.intsize()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:ExternValGet the type of this extern.
-