Interface ValueLayout.OfInt
- All Superinterfaces:
MemoryLayout, ValueLayout
- Enclosing interface:
ValueLayout
A value layout whose carrier is
int.class
.- Since:
- 22
- See Also:
-
Nested Class Summary
Nested classes/interfaces declared in interface MemoryLayout
MemoryLayout.PathElement
Nested classes/interfaces declared in interface ValueLayout
ValueLayout.OfBoolean, ValueLayout.OfByte, ValueLayout.OfChar, ValueLayout.OfDouble, ValueLayout.OfFloat, ValueLayout.OfInt, ValueLayout.OfLong, ValueLayout.OfShort
Modifier and TypeInterfaceDescriptionstatic interface
A value layout whose carrier isboolean.class
.static interface
A value layout whose carrier isbyte.class
.static interface
A value layout whose carrier ischar.class
.static interface
A value layout whose carrier isdouble.class
.static interface
A value layout whose carrier isfloat.class
.static interface
A value layout whose carrier isint.class
.static interface
A value layout whose carrier islong.class
.static interface
A value layout whose carrier isshort.class
. -
Field Summary
Fields declared in interface ValueLayout
ADDRESS, ADDRESS_UNALIGNED, JAVA_BOOLEAN, JAVA_BYTE, JAVA_CHAR, JAVA_CHAR_UNALIGNED, JAVA_DOUBLE, JAVA_DOUBLE_UNALIGNED, JAVA_FLOAT, JAVA_FLOAT_UNALIGNED, JAVA_INT, JAVA_INT_UNALIGNED, JAVA_LONG, JAVA_LONG_UNALIGNED, JAVA_SHORT, JAVA_SHORT_UNALIGNED
Modifier and TypeFieldDescriptionstatic final AddressLayout
An address layout constant whose size is the same as that of a machine address (size_t
), byte alignment set tosizeof(size_t)
, byte order set toByteOrder.nativeOrder()
.static final AddressLayout
An unaligned address layout constant whose size is the same as that of a machine address (size_t
), and byte order set toByteOrder.nativeOrder()
.static final ValueLayout.OfBoolean
A value layout constant whose size is the same as that of a Javaboolean
, byte alignment set to 1, and byte order set toByteOrder.nativeOrder()
.static final ValueLayout.OfByte
A value layout constant whose size is the same as that of a Javabyte
, byte alignment set to 1, and byte order set toByteOrder.nativeOrder()
.static final ValueLayout.OfChar
A value layout constant whose size is the same as that of a Javachar
, byte alignment set to 2, and byte order set toByteOrder.nativeOrder()
.static final ValueLayout.OfChar
An unaligned value layout constant whose size is the same as that of a Javachar
and byte order set toByteOrder.nativeOrder()
.static final ValueLayout.OfDouble
A value layout constant whose size is the same as that of a Javadouble
, byte alignment set to 8, and byte order set toByteOrder.nativeOrder()
.static final ValueLayout.OfDouble
An unaligned value layout constant whose size is the same as that of a Javadouble
and byte order set toByteOrder.nativeOrder()
.static final ValueLayout.OfFloat
A value layout constant whose size is the same as that of a Javafloat
, byte alignment set to 4, and byte order set toByteOrder.nativeOrder()
.static final ValueLayout.OfFloat
An unaligned value layout constant whose size is the same as that of a Javafloat
and byte order set toByteOrder.nativeOrder()
.static final ValueLayout.OfInt
A value layout constant whose size is the same as that of a Javaint
, byte alignment set to 4, and byte order set toByteOrder.nativeOrder()
.static final ValueLayout.OfInt
An unaligned value layout constant whose size is the same as that of a Javaint
and byte order set toByteOrder.nativeOrder()
.static final ValueLayout.OfLong
A value layout constant whose size is the same as that of a Javalong
, byte alignment set to 8, and byte order set toByteOrder.nativeOrder()
.static final ValueLayout.OfLong
An unaligned value layout constant whose size is the same as that of a Javalong
and byte order set toByteOrder.nativeOrder()
.static final ValueLayout.OfShort
A value layout constant whose size is the same as that of a Javashort
, byte alignment set to 2, and byte order set toByteOrder.nativeOrder()
.static final ValueLayout.OfShort
An unaligned value layout constant whose size is the same as that of a Javashort
and byte order set toByteOrder.nativeOrder()
. -
Method Summary
Modifier and TypeMethodDescriptionwithByteAlignment
(long byteAlignment) Returns a memory layout with the same characteristics as this layout, but with the given alignment constraint (in bytes).Returns a memory layout with the same characteristics as this layout, but with the given name.Returns a value layout with the same characteristics as this layout, but with the given byte order.Returns a memory layout with the same characteristics as this layout, but with no name.Methods declared in interface MemoryLayout
arrayElementVarHandle, byteAlignment, byteOffset, byteOffsetHandle, byteSize, equals, hashCode, name, scale, scaleHandle, select, sliceHandle, toString, varHandle
Modifier and TypeMethodDescriptionarrayElementVarHandle
(MemoryLayout.PathElement... elements) Creates a var handle that accesses adjacent elements in a memory segment at offsets selected by the given layout path, where the accessed elements have this layout, and where the initial layout in the path is this layout.long
Returns the alignment constraint associated with this layout, expressed in bytes.long
byteOffset
(MemoryLayout.PathElement... elements) Computes the offset, in bytes, of the layout selected by the given layout path, where the initial layout in the path is this layout.byteOffsetHandle
(MemoryLayout.PathElement... elements) Creates a method handle that computes the offset, in bytes, of the layout selected by the given layout path, where the initial layout in the path is this layout.long
byteSize()
Returns the layout size, in bytes.boolean
Compares the specified object with this layout for equality.int
hashCode()
Returns the hash code value for this layout.name()
Returns the name (if any) associated with this layout.long
scale
(long offset, long index) Returnsoffset + (byteSize() * index)
.Returns a method handle that can be used to invokeMemoryLayout.scale(long, long)
on this layout.select
(MemoryLayout.PathElement... elements) Returns the layout selected from the provided path, where the initial layout in the path is this layout.sliceHandle
(MemoryLayout.PathElement... elements) Creates a method handle which, given a memory segment, returns a slice corresponding to the layout selected by the given layout path, where the initial layout in the path is this layout.toString()
Returns the string representation of this layout.varHandle
(MemoryLayout.PathElement... elements) Creates a var handle that accesses a memory segment at the offset selected by the given layout path, where the initial layout in the path is this layout.Methods declared in interface ValueLayout
carrier, order, varHandle
-
Method Details
-
withName
Returns a memory layout with the same characteristics as this layout, but with the given name.- Specified by:
withName
in interfaceMemoryLayout
- Specified by:
withName
in interfaceValueLayout
- Parameters:
name
- the layout name- Returns:
- a memory layout with the same characteristics as this layout, but with the given name
- See Also:
-
withoutName
ValueLayout.OfInt withoutName()Returns a memory layout with the same characteristics as this layout, but with no name.- Specified by:
withoutName
in interfaceMemoryLayout
- Specified by:
withoutName
in interfaceValueLayout
- Returns:
- a memory layout with the same characteristics as this layout, but with no name
- See Also:
-
withByteAlignment
Returns a memory layout with the same characteristics as this layout, but with the given alignment constraint (in bytes).- Specified by:
withByteAlignment
in interfaceMemoryLayout
- Specified by:
withByteAlignment
in interfaceValueLayout
- Parameters:
byteAlignment
- the layout alignment constraint, expressed in bytes- Returns:
- a memory layout with the same characteristics as this layout, but with the given alignment constraint (in bytes)
- Throws:
IllegalArgumentException
- ifbyteAlignment
is not a power of two
-
withOrder
Returns a value layout with the same characteristics as this layout, but with the given byte order.- Specified by:
withOrder
in interfaceValueLayout
- Parameters:
order
- the desired byte order- Returns:
- a value layout with the same characteristics as this layout, but with the given byte order
-