APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.internal.foreign.layout

pack-priv abstract sealed Class AbstractGroupLayout<L extends AbstractGroupLayout<L> & MemoryLayout>

extends AbstractLayout<L extends AbstractGroupLayout<L> & MemoryLayout>
permits StructLayoutImpl, UnionLayoutImpl
Class Inheritance
Known Direct Subclasses
jdk.internal.foreign.layout.StructLayoutImpl, jdk.internal.foreign.layout.UnionLayoutImpl
Imports
java.lang.foreign.MemoryLayout, java.util.List, .Objects, .Optional, java.util.stream.Collectors

A compound layout that aggregates multiple member layouts. There are two ways in which member layouts can be combined: if member layouts are laid out one after the other, the resulting group layout is said to be a struct (see MemoryLayout#structLayout(MemoryLayout...)); conversely, if all member layouts are laid out at the same starting offset, the resulting group layout is said to be a union (see MemoryLayout#unionLayout(MemoryLayout...)).

Implementation Specification

This class is immutable, thread-safe and value-based.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum
AbstractGroupLayout.Kind

The group kind.

Field Summary

Modifier and TypeField and Description
private final List<MemoryLayout>
private final AbstractGroupLayout.Kind
pack-priv final long

Constructor Summary

AccessConstructor and Description
pack-priv
AbstractGroupLayout(AbstractGroupLayout.Kind kind, List<MemoryLayout> elements, long byteSize, long byteAlignment, long minByteAlignment, Optional<String> name)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object other)

Overrides jdk.internal.foreign.layout.AbstractLayout.equals.

Compares the specified object with this layout for equality.

public final int
hashCode()

Overrides jdk.internal.foreign.layout.AbstractLayout.hashCode.

Returns the hash code value for this layout.

public final boolean
public final List<MemoryLayout>

Returns:

the member layouts associated with this group.
memberLayouts
()

Returns the member layouts associated with this group.

public final String
toString()

Implements abstract jdk.internal.foreign.layout.AbstractLayout.toString.

Returns the string representation of this layout.

public L
Inherited from jdk.internal.foreign.layout.AbstractLayout:
arrayElementVarHandlebyteAlignmentbyteOffsetbyteOffsetHandlebyteSizedecorateLayoutStringdupnamescalescaleHandleselectsliceHandlevarHandlevarHandleInternalwithNamewithoutName

Field Detail

elementsback to summary
private final List<MemoryLayout> elements
kindback to summary
private final AbstractGroupLayout.Kind kind
minByteAlignmentback to summary
pack-priv final long minByteAlignment

Constructor Detail

AbstractGroupLayoutback to summary
pack-priv AbstractGroupLayout(AbstractGroupLayout.Kind kind, List<MemoryLayout> elements, long byteSize, long byteAlignment, long minByteAlignment, Optional<String> name)

Method Detail

equalsback to summary
public final boolean equals(Object other)

Overrides jdk.internal.foreign.layout.AbstractLayout.equals.

Doc from jdk.internal.foreign.layout.AbstractLayout.equals.

Compares the specified object with this layout for equality. Returns true if and only if the specified object is also a layout, and it is equal to this layout. Two layouts are considered equal if they are of the same kind, have the same size, name and alignment constraints. Furthermore, depending on the layout kind, additional conditions must be satisfied:

Annotations
@Override
hashCodeback to summary
public final int hashCode()

Overrides jdk.internal.foreign.layout.AbstractLayout.hashCode.

Doc from jdk.internal.foreign.layout.AbstractLayout.hashCode.

Returns the hash code value for this layout.

Annotations
@Override
hasNaturalAlignmentback to summary
public final boolean hasNaturalAlignment()

Overrides jdk.internal.foreign.layout.AbstractLayout.hasNaturalAlignment.

Annotations
@Override
memberLayoutsback to summary
public final List<MemoryLayout> memberLayouts()

Returns the member layouts associated with this group.

API Note

the order in which member layouts are returned is the same order in which member layouts have been passed to one of the group layout factory methods (see MemoryLayout#structLayout(MemoryLayout...), MemoryLayout#unionLayout(MemoryLayout...)).

Returns:List<MemoryLayout>

the member layouts associated with this group.

toStringback to summary
public final String toString()

Implements abstract jdk.internal.foreign.layout.AbstractLayout.toString.

Doc from jdk.internal.foreign.layout.AbstractLayout.toString.

Returns the string representation of this layout.

Annotations
@Override
withByteAlignmentback to summary
public L withByteAlignment(long byteAlignment)

Overrides jdk.internal.foreign.layout.AbstractLayout.withByteAlignment.

Annotations
@Override
jdk.internal.foreign.layout back to summary

pack-priv final Enum AbstractGroupLayout.Kind

extends Enum<AbstractGroupLayout.Kind>
Class Inheritance

The group kind.

Field Summary

Modifier and TypeField and Description
pack-priv final String
public static final AbstractGroupLayout.Kind
STRUCT

A 'struct' kind.

public static final AbstractGroupLayout.Kind
UNION

A 'union' kind.

Constructor Summary

AccessConstructor and Description
private
Kind(String delimTag)

Method Summary

Modifier and TypeMethod and Description
public static AbstractGroupLayout.Kind
public static AbstractGroupLayout.Kind[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

delimTagback to summary
pack-priv final String delimTag
STRUCTback to summary
public static final AbstractGroupLayout.Kind STRUCT

A 'struct' kind.

UNIONback to summary
public static final AbstractGroupLayout.Kind UNION

A 'union' kind.

Constructor Detail

Kindback to summary
private Kind(String delimTag)

Method Detail

valueOfback to summary
public static AbstractGroupLayout.Kind valueOf(String name)
valuesback to summary
public static AbstractGroupLayout.Kind[] values()