Class LongPtr
java.lang.Object
overrungl.struct.GroupType
overrungl.util.LongPtr
- All Implemented Interfaces:
Addressable
Represents LongPtr.
Layout
struct LongPtr {
jlong value;
};
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StructLayoutThe struct layout ofLongPtr.static final MemoryLayoutThe memory layout ofvalue.static final longThe byte offset ofvalue.static final VarHandle -
Constructor Summary
ConstructorsConstructorDescriptionLongPtr(MemorySegment segment, long elementCount) CreatesLongPtrwith the given segment. -
Method Summary
Modifier and TypeMethodDescriptionstatic LongPtralloc(SegmentAllocator allocator) Allocates aLongPtrwith the given segment allocator.static LongPtralloc(SegmentAllocator allocator, long count) Allocates aLongPtrwith the given segment allocator and count.asSlice(long index) Creates a slice ofLongPtr.asSlice(long index, long count) Creates a slice ofLongPtr.VisitsLongPtrbuffer at the given index.Copies from the given source.static LongPtrof(MemorySegment segment) CreatesLongPtrwith the given segment.static LongPtrofNative(MemorySegment segment) CreatesLongPtrwith the given segment.static LongPtrofNative(MemorySegment segment, long count) CreatesLongPtrwith the given segment.reinterpret(long count) Reinterprets this buffer with the given count.longvalue()Returnsvalue.value(long value) Setsvaluewith the given value.static longvalue(MemorySegment segment, long index) Returnsvalueat the given index.static voidvalue(MemorySegment segment, long index, long value) Setsvaluewith the given value at the given index.longvalueAt(long index) Returnsvalueat the given index.valueAt(long index, long value) Setsvaluewith the given value at the given index.Methods inherited from class 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
CreatesLongPtrwith the given segment.- Parameters:
segment- the memory segmentelementCount- the element count of this struct buffer
-
-
Method Details
-
of
CreatesLongPtrwith the given segment.- Parameters:
segment- the memory segment- Returns:
- the created instance or
nullif the segment isNULL
-
ofNative
Creates
LongPtrwith the given segment.Reinterprets the segment if zero-length.
- Parameters:
segment- the memory segment- Returns:
- the created instance or
nullif the segment isNULL
-
ofNative
Creates
LongPtrwith the given segment.Reinterprets the segment if zero-length.
- Parameters:
segment- the memory segmentcount- the count of the buffer- Returns:
- the created instance or
nullif the segment isNULL
-
alloc
Allocates aLongPtrwith the given segment allocator.- Parameters:
allocator- the segment allocator- Returns:
- the allocated
LongPtr
-
alloc
Allocates aLongPtrwith 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
Returnsvalueat the given index.- Parameters:
segment- the segment of the structindex- the index of the struct buffer- Returns:
valueat the given index
-
value
public long value()Returnsvalue.- Returns:
value
-
value
Setsvaluewith the given value at the given index.- Parameters:
segment- the segment of the structindex- the index of the struct buffervalue- the value
-
value
Setsvaluewith 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) Returnsvalueat the given index.- Parameters:
index- the index of the struct buffer- Returns:
valueat the given index
-
valueAt
Setsvaluewith the given value at the given index.- Parameters:
index- the index of the struct buffervalue- the value- Returns:
this
-