Uses of Interface java.lang.foreign.MemoryLayout (Java SE 21 & JDK 21)
Description: use: module: java.base, package: java.lang.foreign, interface: MemoryLayout

# Uses of Interface
java.lang.foreign.MemoryLayout

Packages that use MemoryLayoutPREVIEW
Package
Description
java.lang.foreign
Provides low-level access to memory and functions outside the Java runtime.

- ## Uses of MemoryLayoutPREVIEW in java.lang.foreign

  Subinterfaces of MemoryLayoutPREVIEW in java.lang.foreign
  Modifier and Type
  Interface
  Description
  `interface`
  `AddressLayoutPREVIEW`
  Preview.
  A value layout used to model the address of some region of memory.
  `interface`
  `GroupLayoutPREVIEW`
  Preview.
  A compound layout that is an aggregation of multiple, heterogeneous member layouts.
  `interface`
  `PaddingLayoutPREVIEW`
  Preview.
  A padding layout.
  `interface`
  `SequenceLayoutPREVIEW`
  Preview.
  A compound layout that denotes a homogeneous repetition of a given element layout.
  `interface`
  `StructLayoutPREVIEW`
  Preview.
  A group layout whose member layouts are laid out one after the other.
  `interface`
  `UnionLayoutPREVIEW`
  Preview.
  A group layout whose member layouts are laid out at the same starting offset.
  `interface`
  `ValueLayoutPREVIEW`
  Preview.
  A layout that models values of basic data types.
  `static interface`
  `ValueLayout.OfBooleanPREVIEW`
  Preview.
  A value layout whose carrier is `boolean.class`.
  `static interface`
  `ValueLayout.OfBytePREVIEW`
  Preview.
  A value layout whose carrier is `byte.class`.
  `static interface`
  `ValueLayout.OfCharPREVIEW`
  Preview.
  A value layout whose carrier is `char.class`.
  `static interface`
  `ValueLayout.OfDoublePREVIEW`
  Preview.
  A value layout whose carrier is `double.class`.
  `static interface`
  `ValueLayout.OfFloatPREVIEW`
  Preview.
  A value layout whose carrier is `float.class`.
  `static interface`
  `ValueLayout.OfIntPREVIEW`
  Preview.
  A value layout whose carrier is `int.class`.
  `static interface`
  `ValueLayout.OfLongPREVIEW`
  Preview.
  A value layout whose carrier is `long.class`.
  `static interface`
  `ValueLayout.OfShortPREVIEW`
  Preview.
  A value layout whose carrier is `short.class`.
  Methods in java.lang.foreign that return MemoryLayoutPREVIEW
  Modifier and Type
  Method
  Description
  `MemoryLayoutPREVIEW`
  SequenceLayout.`elementLayout()`
  Returns the element layout of this sequence layout.
  `default MemoryLayoutPREVIEW`
  MemoryLayout.`select(MemoryLayout.PathElementPREVIEW... elements)`
  Returns the layout selected from the provided path, where the initial layout in the path is this layout.
  `MemoryLayoutPREVIEW`
  MemoryLayout.`withByteAlignment(long byteAlignment)`
  Returns a memory layout with the same characteristics as this layout, but with the given alignment constraint (in bytes).
  `MemoryLayoutPREVIEW`
  MemoryLayout.`withName(String name)`
  Returns a memory layout with the same characteristics as this layout, but with the given name.
  `MemoryLayoutPREVIEW`
  MemoryLayout.`withoutName()`
  Returns a memory layout with the same characteristics as this layout, but with no name.
  Methods in java.lang.foreign that return types with arguments of type MemoryLayoutPREVIEW
  Modifier and Type
  Method
  Description
  `List<MemoryLayoutPREVIEW>`
  FunctionDescriptor.`argumentLayouts()`
  Returns the argument layouts of this function descriptor (as an unmodifiable list).
  `List<MemoryLayoutPREVIEW>`
  GroupLayout.`memberLayouts()`
  Returns the member layouts of this group layout.
  `Optional<MemoryLayoutPREVIEW>`
  FunctionDescriptor.`returnLayout()`
  Returns the return layout (if any) of this function descriptor.
  `Optional<MemoryLayoutPREVIEW>`
  AddressLayout.`targetLayout()`
  Returns the target layout associated with this address layout (if any).
  Methods in java.lang.foreign with parameters of type MemoryLayoutPREVIEW
  Modifier and Type
  Method
  Description
  `default MemorySegmentPREVIEW`
  SegmentAllocator.`allocate(MemoryLayoutPREVIEW layout)`
  Allocates a memory segment with the given layout.
  `default MemorySegmentPREVIEW`
  SegmentAllocator.`allocateArray(MemoryLayoutPREVIEW elementLayout, long count)`
  Allocates a memory segment with the given element layout and size.
  `FunctionDescriptorPREVIEW`
  FunctionDescriptor.`appendArgumentLayouts(MemoryLayoutPREVIEW... addedLayouts)`
  Returns a function descriptor with the given argument layouts appended to the argument layouts of this function descriptor.
  `default MemorySegmentPREVIEW`
  MemorySegment.`asSlice(long offset, MemoryLayoutPREVIEW layout)`
  Returns a slice of this memory segment with the given layout, at the given offset.
  `FunctionDescriptorPREVIEW`
  FunctionDescriptor.`changeReturnLayout(MemoryLayoutPREVIEW newReturn)`
  Returns a function descriptor with the provided return layout.
  `Stream<MemorySegmentPREVIEW>`
  MemorySegment.`elements(MemoryLayoutPREVIEW elementLayout)`
  Returns a sequential `Stream` over disjoint slices (whose size matches that of the specified layout) in this segment.
  `FunctionDescriptorPREVIEW`
  FunctionDescriptor.`insertArgumentLayouts(int index, MemoryLayoutPREVIEW... addedLayouts)`
  Returns a function descriptor with the given argument layouts inserted at the given index, into the argument layout array of this function descriptor.
  `static FunctionDescriptorPREVIEW`
  FunctionDescriptor.`of(MemoryLayoutPREVIEW resLayout, MemoryLayoutPREVIEW... argLayouts)`
  Creates a function descriptor with the given return and argument layouts.
  `static FunctionDescriptorPREVIEW`
  FunctionDescriptor.`ofVoid(MemoryLayoutPREVIEW... argLayouts)`
  Creates a function descriptor with the given argument layouts and no return layout.
  `static SequenceLayoutPREVIEW`
  MemoryLayout.`sequenceLayout(long elementCount, MemoryLayoutPREVIEW elementLayout)`
  Creates a sequence layout with the given element layout and element count.
  `static SequenceLayoutPREVIEW`
  MemoryLayout.`sequenceLayout(MemoryLayoutPREVIEW elementLayout)`
  Creates a sequence layout with the given element layout and the maximum element count such that it does not overflow a `long`.
  `Spliterator<MemorySegmentPREVIEW>`
  MemorySegment.`spliterator(MemoryLayoutPREVIEW elementLayout)`
  Returns a spliterator for this memory segment.
  `static StructLayoutPREVIEW`
  MemoryLayout.`structLayout(MemoryLayoutPREVIEW... elements)`
  Creates a struct layout with the given member layouts.
  `static UnionLayoutPREVIEW`
  MemoryLayout.`unionLayout(MemoryLayoutPREVIEW... elements)`
  Creates a union layout with the given member layouts.
  `AddressLayoutPREVIEW`
  AddressLayout.`withTargetLayout(MemoryLayoutPREVIEW layout)`
  Returns an address layout with the same carrier, alignment constraint, name and order as this address layout, but associated with the specified target layout.