- All Implemented Interfaces:
MemoryLayoutPREVIEW
- Enclosing class:
ValueLayoutPREVIEW
OfShort is a preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
A value layout whose carrier is
short.class.- Since:
- 19
-
Nested Class Summary
Nested classes/interfaces declared in class java.lang.foreign.ValueLayoutPREVIEW
ValueLayout.OfAddressPREVIEW, ValueLayout.OfBooleanPREVIEW, ValueLayout.OfBytePREVIEW, ValueLayout.OfCharPREVIEW, ValueLayout.OfDoublePREVIEW, ValueLayout.OfFloatPREVIEW, ValueLayout.OfIntPREVIEW, ValueLayout.OfLongPREVIEW, ValueLayout.OfShortPREVIEWNested classes/interfaces declared in interface java.lang.foreign.MemoryLayoutPREVIEW
MemoryLayout.PathElementPREVIEW -
Field Summary
Fields declared in class java.lang.foreign.ValueLayoutPREVIEW
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.booleanReturns true, if this layout is a padding layout.name()Returns the name (if any) associated with this layout.withBitAlignment(long alignmentBits) Returns a memory layout with the same size and name as this layout, but with the specified alignment constraints (in bits).Returns a memory layout with the same size and alignment constraints as this layout, but with the specified name.Returns a value layout with the same carrier, alignment constraints and name as this value layout, but with the specified byte order.Methods declared in class java.lang.foreign.ValueLayoutPREVIEW
arrayElementVarHandle, carrier, equals, hashCode, order, toStringMethods declared in class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods declared in interface java.lang.foreign.MemoryLayoutPREVIEW
bitAlignment, bitOffset, bitOffsetHandle, bitSize, byteAlignment, byteOffset, byteOffsetHandle, byteSize, isPadding, name, select, sliceHandle, varHandle
-
Method Details
-
withName
Description copied from interface:MemoryLayoutReturns a memory layout with the same size and alignment constraints as this layout, but with the specified name.- Specified by:
withNamein interfaceMemoryLayoutPREVIEW- Parameters:
name- the layout name.- Returns:
- a memory layout with the given name.
- See Also:
-
withBitAlignment
Description copied from interface:MemoryLayoutReturns a memory layout with the same size and name as this layout, but with the specified alignment constraints (in bits).- Specified by:
withBitAlignmentin interfaceMemoryLayoutPREVIEW- Parameters:
alignmentBits- the layout alignment constraint, expressed in bits.- Returns:
- a memory layout with the given alignment constraints.
-
withOrder
Description copied from class:ValueLayoutReturns a value layout with the same carrier, alignment constraints and name as this value layout, but with the specified byte order.- Overrides:
withOrderin classValueLayoutPREVIEW- Parameters:
order- the desired byte order.- Returns:
- a value layout with the given byte order.
-
name
Description copied from interface:MemoryLayoutReturns the name (if any) associated with this layout.- Specified by:
namein interfaceMemoryLayoutPREVIEW- 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)PREVIEW), then this method returns the natural alignment constraint (in bits) associated with this layout.- Specified by:
bitAlignmentin interfaceMemoryLayoutPREVIEW- Returns:
- the layout alignment constraint, in bits.
-
byteSize
public long byteSize()Description copied from interface:MemoryLayoutReturns the layout size, in bytes.- Specified by:
byteSizein interfaceMemoryLayoutPREVIEW- Returns:
- the layout size, in bytes
-
bitSize
public long bitSize()Description copied from interface:MemoryLayoutReturns the layout size, in bits.- Specified by:
bitSizein interfaceMemoryLayoutPREVIEW- 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 interfaceMemoryLayoutPREVIEW- Returns:
- true, if this layout is a padding layout
-
OfShortwhen preview features are enabled.