java.lang.Object
jdk.incubator.foreign.ValueLayout
jdk.incubator.foreign.ValueLayout.OfByte
- All Implemented Interfaces:
Constable,MemoryLayout
- Enclosing class:
ValueLayout
A value layout whose carrier is
byte.class.-
Nested Class Summary
Nested classes/interfaces declared in class jdk.incubator.foreign.ValueLayout
ValueLayout.OfAddress, ValueLayout.OfBoolean, ValueLayout.OfByte, ValueLayout.OfChar, ValueLayout.OfDouble, ValueLayout.OfFloat, ValueLayout.OfInt, ValueLayout.OfLong, ValueLayout.OfShortNested classes/interfaces declared in interface jdk.incubator.foreign.MemoryLayout
MemoryLayout.PathElement -
Field Summary
Fields declared in class jdk.incubator.foreign.ValueLayout
ADDRESS, JAVA_BOOLEAN, JAVA_BYTE, JAVA_CHAR, JAVA_DOUBLE, JAVA_FLOAT, JAVA_INT, JAVA_LONG, JAVA_SHORT -
Method Summary
Modifier and TypeMethodDescriptionfinal longReturns the alignment constraint associated with this layout, expressed in bits.longbitSize()Returns the layout size, in bits.longbyteSize()Returns the layout size, in bytes.booleanhasSize()Returnstrueif this layout has a specified size.booleanReturns true, if this layout is a padding layout.name()Returns the name (if any) associated with this layout.withBitAlignment(long alignmentBits) Creates a new layout which features the desired alignment constraint.Creates a new layout which features the desired layout name.Returns a new value layout with given byte order.Methods declared in class jdk.incubator.foreign.ValueLayout
carrier, describeConstable, equals, hashCode, order, toStringMethods declared in class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods declared in interface jdk.incubator.foreign.MemoryLayout
bitAlignment, bitOffset, bitOffsetHandle, bitSize, byteAlignment, byteOffset, byteOffsetHandle, byteSize, hasSize, isPadding, map, name, select, sliceHandle, varHandle
-
Method Details
-
withName
Description copied from interface:MemoryLayoutCreates a new layout which features the desired layout name.- Specified by:
withNamein interfaceMemoryLayout- Parameters:
name- the layout name.- Returns:
- a new layout which is the same as this layout, except for the name associated with it.
- See Also:
-
withBitAlignment
Description copied from interface:MemoryLayoutCreates a new layout which features the desired alignment constraint.- Specified by:
withBitAlignmentin interfaceMemoryLayout- Parameters:
alignmentBits- the layout alignment constraint, expressed in bits.- Returns:
- a new layout which is the same as this layout, except for the alignment constraint associated with it.
-
withOrder
Description copied from class:ValueLayoutReturns a new value layout with given byte order.- Overrides:
withOrderin classValueLayout- Parameters:
order- the desired byte order.- Returns:
- a new value layout with given byte order.
-
name
Description copied from interface:MemoryLayoutReturns the name (if any) associated with this layout.- Specified by:
namein interfaceMemoryLayout- Returns:
- the name (if any) associated with this layout
- See Also:
-
bitAlignment
public final long bitAlignment()Description copied from interface:MemoryLayoutReturns the alignment constraint associated with this layout, expressed in bits. Layout alignment defines a power of twoAwhich is the bit-wise alignment of the layout. IfA <= 8thenA/8is the number of bytes that must be aligned for any pointer that correctly points to this layout. Thus:A=8means unaligned (in the usual sense), which is common in packets.A=64means word aligned (on LP64),A=32int aligned,A=16short aligned, etc.A=512is the most strict alignment required by the x86/SV ABI (for AVX-512 data).
MemoryLayout.withBitAlignment(long)), then this method returns the natural alignment constraint (in bits) associated with this layout.- Specified by:
bitAlignmentin interfaceMemoryLayout- Returns:
- the layout alignment constraint, in bits.
-
byteSize
public long byteSize()Description copied from interface:MemoryLayoutReturns the layout size, in bytes.- Specified by:
byteSizein interfaceMemoryLayout- Returns:
- the layout size, in bytes
-
hasSize
public boolean hasSize()Description copied from interface:MemoryLayoutReturnstrueif this layout has a specified size. A layout does not have a specified size if it is (or contains) a sequence layout whose size is unspecified (seeSequenceLayout.elementCount()). Value layouts (seeValueLayout) and padding layouts (seeMemoryLayout.paddingLayout(long)) always have a specified size, therefore this method always returnstruein these cases.- Specified by:
hasSizein interfaceMemoryLayout- Returns:
true, if this layout has a specified size.
-
bitSize
public long bitSize()Description copied from interface:MemoryLayoutReturns the layout size, in bits.- Specified by:
bitSizein interfaceMemoryLayout- Returns:
- the layout size, in bits
-
isPadding
public boolean isPadding()Description copied from interface:MemoryLayoutReturns true, if this layout is a padding layout.- Specified by:
isPaddingin interfaceMemoryLayout- Returns:
- true, if this layout is a padding layout
-