Class BitsetIter
- All Implemented Interfaces:
Proxy
GtkBitset
.
Before a GtkBitsetIter
can be used, it needs to be initialized with
initFirst(org.gnome.gtk.BitsetIter, org.gnome.gtk.Bitset, io.github.jwharm.javagi.base.Out<java.lang.Integer>)
, initLast(org.gnome.gtk.BitsetIter, org.gnome.gtk.Bitset, io.github.jwharm.javagi.base.Out<java.lang.Integer>)
or initAt(org.gnome.gtk.BitsetIter, org.gnome.gtk.Bitset, int, io.github.jwharm.javagi.base.Out<java.lang.Integer>)
.
-
Constructor Summary
ConstructorDescriptionAllocate a new BitsetIter.BitsetIter
(Arena arena) Allocate a new BitsetIter.BitsetIter
(MemorySegment address) Create a BitsetIter proxy instance for the provided memory address.BitsetIter
(MemorySegment[] privateData) Allocate a new BitsetIter with the fields set to the provided values.BitsetIter
(MemorySegment[] privateData, Arena arena) Allocate a new BitsetIter with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayout
The memory layout of the native struct.static Type
getType()
Get the GType of the BitsetIter classint
getValue()
Gets the current value that this BitsetIter points to.static boolean
initAt
(BitsetIter iter, Bitset set, int target, @Nullable Out<Integer> value) Initializesiter
to point totarget
.static boolean
initFirst
(BitsetIter iter, Bitset set, @Nullable Out<Integer> value) Initializes an iterator forset
and points it to the first value inset
.static boolean
initLast
(BitsetIter iter, Bitset set, @Nullable Out<Integer> value) Initializes an iterator forset
and points it to the last value inset
.boolean
isValid()
Checks if this BitsetIter points to a valid value.boolean
Moves this BitsetIter to the next value in the set.boolean
Moves this BitsetIter to the previous value in the set.Read the value of the fieldprivate_data
.void
writePrivateData
(MemorySegment[] privateData, Arena _arena) Write a value in the fieldprivate_data
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
BitsetIter
Create a BitsetIter proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
BitsetIter
Allocate a new BitsetIter.- Parameters:
arena
- to control the memory allocation scope
-
BitsetIter
public BitsetIter()Allocate a new BitsetIter. The memory is allocated withArena.ofAuto()
. -
BitsetIter
Allocate a new BitsetIter with the fields set to the provided values.- Parameters:
privateData
- value for the fieldprivateData
arena
- to control the memory allocation scope
-
BitsetIter
Allocate a new BitsetIter with the fields set to the provided values. The memory is allocated withArena.ofAuto()
.- Parameters:
privateData
- value for the fieldprivateData
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readPrivateData
Read the value of the fieldprivate_data
.- Returns:
- The value of the field
private_data
-
writePrivateData
Write a value in the fieldprivate_data
.- Parameters:
privateData
- The new value for the fieldprivate_data
_arena
- to control the memory allocation scope
-
initAt
public static boolean initAt(BitsetIter iter, Bitset set, int target, @Nullable @Nullable Out<Integer> value) Initializesiter
to point totarget
.If
target
is not found, finds the next value after it. If no value >=target
exists inset
, this function returnsfalse
.- Parameters:
iter
- a pointer to an uninitializedGtkBitsetIter
set
- aGtkBitset
target
- target value to start iterating atvalue
- Set to the found value inset
- Returns:
true
if a value was found.
-
initFirst
public static boolean initFirst(BitsetIter iter, Bitset set, @Nullable @Nullable Out<Integer> value) Initializes an iterator forset
and points it to the first value inset
.If
set
is empty,false
is returned andvalue
is set toG_MAXUINT
.- Parameters:
iter
- a pointer to an uninitializedGtkBitsetIter
set
- aGtkBitset
value
- Set to the first value inset
- Returns:
true
ifset
isn't empty.
-
initLast
Initializes an iterator forset
and points it to the last value inset
.If
set
is empty,false
is returned.- Parameters:
iter
- a pointer to an uninitializedGtkBitsetIter
set
- aGtkBitset
value
- Set to the last value inset
- Returns:
true
ifset
isn't empty.
-
getValue
public int getValue()Gets the current value that this BitsetIter points to.If this BitsetIter is not valid and
isValid()
returnsfalse
, this function returns 0.- Returns:
- The current value pointer to by this BitsetIter
-
isValid
public boolean isValid()Checks if this BitsetIter points to a valid value.- Returns:
true
if this BitsetIter points to a valid value
-
next
Moves this BitsetIter to the next value in the set.If it was already pointing to the last value in the set,
false
is returned and this BitsetIter is invalidated.- Parameters:
value
- Set to the next value- Returns:
true
if a next value existed
-
previous
Moves this BitsetIter to the previous value in the set.If it was already pointing to the first value in the set,
false
is returned and this BitsetIter is invalidated.- Parameters:
value
- Set to the previous value- Returns:
true
if a previous value existed
-