Interface Group<L extends GroupLayout, T extends Group<L,T>>

All Known Subinterfaces:
Struct<T>, Union<T>

public sealed interface Group<L extends GroupLayout, T extends Group<L,T>> permits Struct<T>, Union<T>
A struct or union interface may extend this capability interface to expose GroupBinder functionality at the instance level.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the memory address of this group.
    default long
    Returns the alignment, in bytes, of this group.
    Returns a memory segment view of this group.
    Clears the content of this group.
    copyFrom(T src)
    Copies the content of the specified source group to this group.
    get(MemorySegment segment)
    Copies the content of the specified memory segment to this group.
    get(MemorySegment segment, long offset)
    Copies the content of the specified memory segment at the given offset to this group.
    getAtIndex(MemorySegment segment, long index)
    Copies the content of the specified memory segment at the given index to this group.
    Returns the layout of this group.
    set(MemorySegment segment)
    Copies the content of this group to the specified memory segment.
    set(MemorySegment array, long offset)
    Copies the content of this group to the specified memory segment at the given offset.
    setAtIndex(MemorySegment array, long index)
    Copies the content of this group to the specified memory segment at the given index.
    default long
    Returns the size, in bytes, of this group.
  • Method Details

    • layout

      L layout()
      Returns the layout of this group.
      Returns:
      the layout
    • address

      long address()
      Returns the memory address of this group.
      Returns:
      the memory address
    • copyFrom

      T copyFrom(T src)
      Copies the content of the specified source group to this group.
      Parameters:
      src - the source group
      Returns:
      this group
    • clear

      T clear()
      Clears the content of this group.
      Returns:
      this group
    • get

      T get(MemorySegment segment)
      Copies the content of the specified memory segment to this group.
      Parameters:
      segment - the source memory segment
      Returns:
      this group
    • get

      T get(MemorySegment segment, long offset)
      Copies the content of the specified memory segment at the given offset to this group.
      Parameters:
      segment - the source memory segment
      offset - the offset within the segment
      Returns:
      this group
    • getAtIndex

      T getAtIndex(MemorySegment segment, long index)
      Copies the content of the specified memory segment at the given index to this group.
      Parameters:
      segment - the source memory segment
      index - the index within the segment
      Returns:
      this group
    • set

      T set(MemorySegment segment)
      Copies the content of this group to the specified memory segment.
      Parameters:
      segment - the target memory segment
      Returns:
      this groupn
    • set

      T set(MemorySegment array, long offset)
      Copies the content of this group to the specified memory segment at the given offset.
      Parameters:
      array - the target memory segment
      offset - the offset within the segment
      Returns:
      this group
    • setAtIndex

      T setAtIndex(MemorySegment array, long index)
      Copies the content of this group to the specified memory segment at the given index.
      Parameters:
      array - the target memory segment
      index - the index within the segment
      Returns:
      this group
    • sizeof

      default long sizeof()
      Returns the size, in bytes, of this group.
      Returns:
      the size
    • alignof

      default long alignof()
      Returns the alignment, in bytes, of this group.
      Returns:
      the alignment
    • asSegment

      default MemorySegment asSegment()
      Returns a memory segment view of this group.
      Returns:
      the memory segment