APIdia Launch Partner
Top Description Methods
java.lang.foreign

public sealed Interface UnionLayout

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

A group layout whose member layouts are laid out at the same starting offset.

Implementation Specification

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

Since
22

Method Summary

Modifier and TypeMethod and Description
public UnionLayout
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 UnionLayout
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 UnionLayout
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 UnionLayout 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 UnionLayout 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 UnionLayout 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