Class PanamaTable

java.lang.Object
ai.tegmentum.wasmtime4j.panama.PanamaTable
All Implemented Interfaces:
ai.tegmentum.wasmtime4j.WasmTable

public final class PanamaTable extends Object implements ai.tegmentum.wasmtime4j.WasmTable
Panama FFI implementation of WebAssembly Table.
Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the table and releases resources.
    void
    copy(int dst, int src, int count)
     
    void
    copy(int dst, ai.tegmentum.wasmtime4j.WasmTable src, int srcIndex, int count)
     
    void
    copy(long dstIndex, ai.tegmentum.wasmtime4j.WasmTable srcTable, long srcIndex, long length)
    Copies elements from another table to this table.
    void
    dropElementSegment(int elementSegmentIndex)
     
    void
    fill(int start, int count, Object value)
     
    void
    fill(long dstIndex, Object value, long length)
    Fills a region of this table with the specified value.
    get(int index)
     
    ai.tegmentum.wasmtime4j.WasmValueType
     
    int
     
    Gets the native table pointer.
    int
     
    ai.tegmentum.wasmtime4j.type.TableType
     
    ai.tegmentum.wasmtime4j.WasmValueType
     
    int
    grow(int elements, Object initValue)
     
    int
    growAsync(int elements, Object initValue)
     
    void
    init(int destIndex, int elementSegmentIndex, int srcIndex, int count)
     
    void
    set(int index, Object value)
     
    boolean
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface ai.tegmentum.wasmtime4j.WasmTable

    copy64, fill64, get64, getSize64, grow64, init64, set64, size
  • Method Details

    • getSize

      public int getSize()
      Specified by:
      getSize in interface ai.tegmentum.wasmtime4j.WasmTable
    • getType

      public ai.tegmentum.wasmtime4j.WasmValueType getType()
      Specified by:
      getType in interface ai.tegmentum.wasmtime4j.WasmTable
    • getTableType

      public ai.tegmentum.wasmtime4j.type.TableType getTableType()
      Specified by:
      getTableType in interface ai.tegmentum.wasmtime4j.WasmTable
    • grow

      public int grow(int elements, Object initValue)
      Specified by:
      grow in interface ai.tegmentum.wasmtime4j.WasmTable
    • getMaxSize

      public int getMaxSize()
      Specified by:
      getMaxSize in interface ai.tegmentum.wasmtime4j.WasmTable
    • get

      public Object get(int index)
      Specified by:
      get in interface ai.tegmentum.wasmtime4j.WasmTable
    • set

      public void set(int index, Object value)
      Specified by:
      set in interface ai.tegmentum.wasmtime4j.WasmTable
    • getElementType

      public ai.tegmentum.wasmtime4j.WasmValueType getElementType()
      Specified by:
      getElementType in interface ai.tegmentum.wasmtime4j.WasmTable
    • fill

      public void fill(int start, int count, Object value)
      Specified by:
      fill in interface ai.tegmentum.wasmtime4j.WasmTable
    • fill

      public void fill(long dstIndex, Object value, long length) throws ai.tegmentum.wasmtime4j.exception.WasmException
      Fills a region of this table with the specified value.
      Parameters:
      dstIndex - the starting index in this table
      value - the value to fill with
      length - the number of elements to fill
      Throws:
      ai.tegmentum.wasmtime4j.exception.WasmException - if the operation fails or indices are out of bounds
    • copy

      public void copy(int dst, int src, int count)
      Specified by:
      copy in interface ai.tegmentum.wasmtime4j.WasmTable
    • copy

      public void copy(int dst, ai.tegmentum.wasmtime4j.WasmTable src, int srcIndex, int count)
      Specified by:
      copy in interface ai.tegmentum.wasmtime4j.WasmTable
    • copy

      public void copy(long dstIndex, ai.tegmentum.wasmtime4j.WasmTable srcTable, long srcIndex, long length) throws ai.tegmentum.wasmtime4j.exception.WasmException
      Copies elements from another table to this table.
      Parameters:
      dstIndex - the starting index in this table
      srcTable - the source table to copy from
      srcIndex - the starting index in the source table
      length - the number of elements to copy
      Throws:
      ai.tegmentum.wasmtime4j.exception.WasmException - if the operation fails or indices are out of bounds
    • init

      public void init(int destIndex, int elementSegmentIndex, int srcIndex, int count)
      Specified by:
      init in interface ai.tegmentum.wasmtime4j.WasmTable
    • dropElementSegment

      public void dropElementSegment(int elementSegmentIndex)
      Specified by:
      dropElementSegment in interface ai.tegmentum.wasmtime4j.WasmTable
    • close

      public void close()
      Closes the table and releases resources.
    • getNativeTable

      public MemorySegment getNativeTable()
      Gets the native table pointer.
      Returns:
      native table segment
    • growAsync

      public int growAsync(int elements, Object initValue) throws ai.tegmentum.wasmtime4j.exception.WasmException
      Specified by:
      growAsync in interface ai.tegmentum.wasmtime4j.WasmTable
      Throws:
      ai.tegmentum.wasmtime4j.exception.WasmException
    • supports64BitAddressing

      public boolean supports64BitAddressing()
      Specified by:
      supports64BitAddressing in interface ai.tegmentum.wasmtime4j.WasmTable