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

public abstract sealed Class AbstractLayout<L extends AbstractLayout<L> & MemoryLayout>

extends Object
permits AbstractGroupLayout<L extends AbstractLayout<L> & MemoryLayout>, PaddingLayoutImpl, SequenceLayoutImpl, ValueLayouts.AbstractValueLayout<V>
Class Inheritance
Known Direct Subclasses
jdk.internal.foreign.layout.PaddingLayoutImpl, jdk.internal.foreign.layout.SequenceLayoutImpl, jdk.internal.foreign.layout.ValueLayouts.AbstractValueLayout, jdk.internal.foreign.layout.AbstractGroupLayout
Imports
jdk.internal.foreign.LayoutPath, .Utils, jdk.internal.invoke.MhUtil, java.lang.foreign.GroupLayout, .MemoryLayout, .MemoryLayout.PathElement, .SequenceLayout, .StructLayout, .UnionLayout, .ValueLayout, java.lang.invoke.MethodHandle, .MethodHandles, .MethodType, .VarHandle, java.util.Objects, .Optional, .Set, java.util.function.Function, .UnaryOperator

Field Summary

Modifier and TypeField and Description
private final long
private final long
private final Optional<String>

Constructor Summary

AccessConstructor and Description
pack-priv
AbstractLayout(long byteSize, long byteAlignment, Optional<String> name)

Method Summary

Modifier and TypeMethod and Description
public VarHandle
public final long
public long
public MethodHandle
public final long
private static <Z> Z
computePathOp(LayoutPath path, Function<LayoutPath, Z> finalizer, Set<Class<?>> badTypes, MemoryLayout.PathElement... elements)

pack-priv String
pack-priv abstract L
dup(long byteAlignment, Optional<String> name)

public boolean

Returns:

true if the specified object is equal to this layout.
equals
(Object
the object to be compared for equality with this layout.
other
)

Overrides java.lang.Object.equals.

Compares the specified object with this layout for equality.

public int

Returns:

the hash code value for this layout
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hash code value for this layout.

public boolean
public final Optional<String>
name()

private static long
public long
scale(long offset, long index)

public MethodHandle
public MemoryLayout
public MethodHandle
public abstract String

Returns:

the string representation of this layout
toString
()

Overrides java.lang.Object.toString.

Returns the string representation of this layout.

public VarHandle
public VarHandle
public L
withByteAlignment(long byteAlignment)

public final L
public final L
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

byteAlignmentback to summary
private final long byteAlignment
byteSizeback to summary
private final long byteSize
nameback to summary
private final Optional<String> name

Constructor Detail

AbstractLayoutback to summary
pack-priv AbstractLayout(long byteSize, long byteAlignment, Optional<String> name)

Method Detail

arrayElementVarHandleback to summary
public VarHandle arrayElementVarHandle(MemoryLayout.PathElement... elements)
byteAlignmentback to summary
public final long byteAlignment()
byteOffsetback to summary
public long byteOffset(MemoryLayout.PathElement... elements)
byteOffsetHandleback to summary
public MethodHandle byteOffsetHandle(MemoryLayout.PathElement... elements)
byteSizeback to summary
public final long byteSize()
computePathOpback to summary
private static <Z> Z computePathOp(LayoutPath path, Function<LayoutPath, Z> finalizer, Set<Class<?>> badTypes, MemoryLayout.PathElement... elements)
decorateLayoutStringback to summary
pack-priv String decorateLayoutString(String s)
dupback to summary
pack-priv abstract L dup(long byteAlignment, Optional<String> name)
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.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:

Parameters
other:Object

the object to be compared for equality with this layout.

Returns:boolean

true if the specified object is equal to this layout.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hash code value for this layout.

Returns:int

the hash code value for this layout

Annotations
@Override
hasNaturalAlignmentback to summary
public boolean hasNaturalAlignment()
nameback to summary
public final Optional<String> name()
requirePowerOfTwoAndGreaterOrEqualToOneback to summary
private static long requirePowerOfTwoAndGreaterOrEqualToOne(long value)
scaleback to summary
public long scale(long offset, long index)
scaleHandleback to summary
public MethodHandle scaleHandle()
selectback to summary
public MemoryLayout select(MemoryLayout.PathElement... elements)
sliceHandleback to summary
public MethodHandle sliceHandle(MemoryLayout.PathElement... elements)
toStringback to summary
public abstract String toString()

Overrides java.lang.Object.toString.

Returns the string representation of this layout.

Returns:String

the string representation of this layout

Annotations
@Override
varHandleback to summary
public VarHandle varHandle(MemoryLayout.PathElement... elements)
varHandleInternalback to summary
public VarHandle varHandleInternal(MemoryLayout.PathElement... elements)
withByteAlignmentback to summary
public L withByteAlignment(long byteAlignment)
withNameback to summary
public final L withName(String name)
withoutNameback to summary
public final L withoutName()
Annotations
@SuppressWarnings:unchecked