APIdia Launch Partner
Top Description Methods
java.lang.foreign

public sealed Interface StructLayout

extends GroupLayout
permits StructLayoutImpl
Known Direct Implementers
jdk.internal.foreign.layout.StructLayoutImpl
Imports
jdk.internal.foreign.layout.StructLayoutImpl

A group layout whose member layouts are laid out one after the other.

Implementation Specification

Implementing classes are immutable, thread-safe and value-based.

Since
22

Method Summary

Modifier and TypeMethod and Description
public StructLayout
withByteAlignment(long byteAlignment)

Redeclares java.lang.foreign.GroupLayout.withByteAlignment.

Returns a memory layout with the same characteristics as this layout, but with the given alignment constraint (in bytes).

public StructLayout
withName(String name)

Redeclares java.lang.foreign.GroupLayout.withName.

Returns a memory layout with the same characteristics as this layout, but with the given name.

public StructLayout
withoutName()

Redeclares java.lang.foreign.GroupLayout.withoutName.

Returns a memory layout with the same characteristics as this layout, but with no name.

Inherited from java.lang.foreign.GroupLayout:
memberLayouts

Method Detail

withByteAlignmentback to summary
public StructLayout withByteAlignment(long byteAlignment)

Redeclares java.lang.foreign.GroupLayout.withByteAlignment.

Doc from java.lang.foreign.GroupLayout.withByteAlignment.

Returns a memory layout with the same characteristics as this layout, but with the given alignment constraint (in bytes).

Annotations
@Override
Exceptions
IllegalArgumentException:
  • if byteAlignment is not a power of two
  • if byteAlignment is less than M, where M is the maximum alignment constraint in any of the member layouts associated with this group layout
withNameback to summary
public StructLayout withName(String name)

Redeclares java.lang.foreign.GroupLayout.withName.

Doc from java.lang.foreign.GroupLayout.withName.

Returns a memory layout with the same characteristics as this layout, but with the given name.

Annotations
@Override
withoutNameback to summary
public StructLayout withoutName()

Redeclares java.lang.foreign.GroupLayout.withoutName.

Doc from java.lang.foreign.GroupLayout.withoutName.

Returns a memory layout with the same characteristics as this layout, but with no name.

Annotations
@Override