Class BitsetIter
- All Implemented Interfaces:
Proxy
Gtk.Bitset.
GtkBitSetIter is an opaque, stack-allocated struct.
Before a GtkBitsetIter` can be used, it needs to be initialized with
initFirst(org.gnome.gtk.BitsetIter, org.gnome.gtk.Bitset, org.javagi.base.Out<java.lang.Integer>), initLast(org.gnome.gtk.BitsetIter, org.gnome.gtk.Bitset, org.javagi.base.Out<java.lang.Integer>)
or initAt(org.gnome.gtk.BitsetIter, org.gnome.gtk.Bitset, int, org.javagi.base.Out<java.lang.Integer>).
-
Constructor Summary
ConstructorsConstructorDescriptionAllocate 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 MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the BitsetIter classintgetValue()Gets the current value that this BitsetIter points to.static booleaninitAt(BitsetIter iter, Bitset set, int target, @Nullable Out<Integer> value) Initializesiterto point totarget.static booleaninitFirst(BitsetIter iter, Bitset set, @Nullable Out<Integer> value) Initializes an iterator forsetand points it to the first value inset.static booleaninitLast(BitsetIter iter, Bitset set, @Nullable Out<Integer> value) Initializes an iterator forsetand points it to the last value inset.booleanisValid()Checks if this BitsetIter points to a valid value.booleanMoves this BitsetIter to the next value in the set.booleanMoves this BitsetIter to the previous value in the set.@Nullable MemorySegment @Nullable []Read the value of the fieldprivate_data.voidwritePrivateData(@Nullable MemorySegment @Nullable [] privateData, Arena _arena) Write a value in the fieldprivate_data.Methods inherited from class org.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 fieldprivateDataarena- 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
-
initAt
Initializesiterto point totarget.If
targetis not found, finds the next value after it. If no value >=targetexists inset,this function returnsfalse.- Parameters:
iter- a pointer to an uninitializedGtkBitsetIterset- aGtkBitsettarget- target value to start iterating atvalue- Set to the found value inset- Returns:
trueif a value was found.
-
initFirst
Initializes an iterator forsetand points it to the first value inset.If
setis empty,falseis returned andvalueis set toG_MAXUINT.- Parameters:
iter- a pointer to an uninitializedGtkBitsetIterset- aGtkBitsetvalue- Set to the first value inset- Returns:
trueifsetisn't empty.
-
initLast
Initializes an iterator forsetand points it to the last value inset.If
setis empty,falseis returned.- Parameters:
iter- a pointer to an uninitializedGtkBitsetIterset- aGtkBitsetvalue- Set to the last value inset- Returns:
trueifsetisn'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:
trueif this BitsetIter points to a valid value
-
next
-
previous
Moves this BitsetIter to the previous value in the set.If it was already pointing to the first value in the set,
falseis returned and this BitsetIter is invalidated.- Parameters:
value- Set to the previous value- Returns:
trueif a previous value existed
-