Class LongPtr
java.lang.Object
overrungl.struct.GroupType
overrungl.util.LongPtr
- All Implemented Interfaces:
Addressable
Layout
struct LongPtr {
jlong value;
};
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GroupLayout
The struct layout ofLongPtr
.static final MemoryLayout
The memory layout ofvalue
.static final long
The byte offset ofvalue
.static final VarHandle
-
Constructor Summary
ConstructorsConstructorDescriptionLongPtr
(MemorySegment segment, long elementCount) CreatesLongPtr
with the given segment. -
Method Summary
Modifier and TypeMethodDescriptionstatic LongPtr
alloc
(SegmentAllocator allocator) Allocates aLongPtr
with the given segment allocator.static LongPtr
alloc
(SegmentAllocator allocator, long count) Allocates aLongPtr
with the given segment allocator and count.asSlice
(long index) Creates a slice ofLongPtr
.asSlice
(long index, long count) Creates a slice ofLongPtr
.VisitsLongPtr
buffer at the given index.Copies from the given source.static LongPtr
of
(MemorySegment segment) CreatesLongPtr
with the given segment.static LongPtr
ofNative
(MemorySegment segment) CreatesLongPtr
with the given segment.static LongPtr
ofNative
(MemorySegment segment, long count) CreatesLongPtr
with the given segment.reinterpret
(long count) Reinterprets this buffer with the given count.long
value()
Returnsvalue
.value
(long value) Setsvalue
with the given value.static long
value
(MemorySegment segment, long index) Returnsvalue
at the given index.static void
value
(MemorySegment segment, long index, long value) Setsvalue
with the given value at the given index.long
valueAt
(long index) Returnsvalue
at the given index.valueAt
(long index, long value) Setsvalue
with the given value at the given index.Methods inherited from class overrungl.struct.GroupType
estimateCount, estimateCount, groupLayout, segment
-
Field Details
-
LAYOUT
The struct layout ofLongPtr
. -
OFFSET_value
public static final long OFFSET_valueThe byte offset ofvalue
. -
LAYOUT_value
The memory layout ofvalue
. -
VH_value
-
-
Constructor Details
-
LongPtr
CreatesLongPtr
with the given segment.- Parameters:
segment
- the memory segmentelementCount
- the element count of this struct buffer
-
-
Method Details
-
of
CreatesLongPtr
with the given segment.- Parameters:
segment
- the memory segment- Returns:
- the created instance or
null
if the segment isNULL
-
ofNative
Creates
LongPtr
with the given segment.Reinterprets the segment if zero-length.
- Parameters:
segment
- the memory segment- Returns:
- the created instance or
null
if the segment isNULL
-
ofNative
Creates
LongPtr
with the given segment.Reinterprets the segment if zero-length.
- Parameters:
segment
- the memory segmentcount
- the count of the buffer- Returns:
- the created instance or
null
if the segment isNULL
-
alloc
Allocates aLongPtr
with the given segment allocator.- Parameters:
allocator
- the segment allocator- Returns:
- the allocated
LongPtr
-
alloc
Allocates aLongPtr
with the given segment allocator and count.- Parameters:
allocator
- the segment allocatorcount
- the count- Returns:
- the allocated
LongPtr
-
copyFrom
-
reinterpret
Reinterprets this buffer with the given count.- Parameters:
count
- the new count- Returns:
- the reinterpreted buffer
-
value
Returnsvalue
at the given index.- Parameters:
segment
- the segment of the structindex
- the index of the struct buffer- Returns:
value
at the given index
-
value
public long value()Returnsvalue
.- Returns:
value
-
value
Setsvalue
with the given value at the given index.- Parameters:
segment
- the segment of the structindex
- the index of the struct buffervalue
- the value
-
value
Setsvalue
with the given value.- Parameters:
value
- the value- Returns:
this
-
asSlice
Creates a slice ofLongPtr
.- Parameters:
index
- the index of the struct buffer- Returns:
- the slice of
LongPtr
-
asSlice
Creates a slice ofLongPtr
.- Parameters:
index
- the index of the struct buffercount
- the count- Returns:
- the slice of
LongPtr
-
at
-
valueAt
public long valueAt(long index) Returnsvalue
at the given index.- Parameters:
index
- the index of the struct buffer- Returns:
value
at the given index
-
valueAt
Setsvalue
with the given value at the given index.- Parameters:
index
- the index of the struct buffervalue
- the value- Returns:
this
-