- Enclosing class:
public static final class ValueLayout.OfShort extends ValueLayout
A value layout whose carrier is
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.OfShort
Method SummaryModifier and TypeMethodDescription
final longReturns the alignment constraint associated with this layout, expressed in bits.
bitSize()Returns the layout size, in bits.
byteSize()Returns the layout size, in bytes.
trueif 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.
(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, toString
Methods declared in class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
withNameCreates a new layout which features the desired layout name.
withBitAlignmentpublic ValueLayout.OfShort withBitAlignment
(long alignmentBits)Creates a new layout which features the desired alignment constraint.
withOrderDescription copied from class:
ValueLayoutReturns a new value layout with given byte order.
nameReturns the name (if any) associated with this layout.
bitAlignmentpublic final long bitAlignment()Returns the alignment constraint associated with this layout, expressed in bits. Layout alignment defines a power of two
Awhich is the bit-wise alignment of the layout. If
A <= 8then
A/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=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.
byteSizepublic long byteSize()Returns the layout size, in bytes.
hasSizepublic boolean hasSize()Returns
trueif 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 (see
SequenceLayout.elementCount()). Value layouts (see
ValueLayout) and padding layouts (see
MemoryLayout.paddingLayout(long)) always have a specified size, therefore this method always returns
truein these cases.
bitSizepublic long bitSize()Returns the layout size, in bits.
isPaddingpublic boolean isPadding()Returns true, if this layout is a padding layout.