Class BitsetIter

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class BitsetIter extends ProxyInstance

Iterates over the elements of a Gtk.Bitset.

`GtkBitSetIter is an opaque, stack-allocated struct.

Before a GtkBitsetIter can be used, it needs to be initialized with initFirst(BitsetIter, Bitset, Out), initLast(BitsetIter, Bitset, Out) or initAt(BitsetIter, Bitset, int, Out).

  • Constructor Details

    • BitsetIter

      public BitsetIter(MemorySegment address)
      Create a BitsetIter proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • BitsetIter

      public BitsetIter(Arena arena)
      Allocate a new BitsetIter.
      Parameters:
      arena - to control the memory allocation scope
    • BitsetIter

      public BitsetIter()
      Allocate a new BitsetIter. The memory is allocated with Arena.ofAuto().
    • BitsetIter

      public BitsetIter(MemorySegment[] privateData, Arena arena)
      Allocate a new BitsetIter with the fields set to the provided values.
      Parameters:
      privateData - value for the field privateData
      arena - to control the memory allocation scope
    • BitsetIter

      public BitsetIter(MemorySegment[] privateData)
      Allocate a new BitsetIter with the fields set to the provided values. The memory is allocated with Arena.ofAuto().
      Parameters:
      privateData - value for the field privateData
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the BitsetIter class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • readPrivateData

      public @Nullable MemorySegment @Nullable [] readPrivateData()
      Read the value of the field private_data.
      Returns:
      The value of the field private_data
    • writePrivateData

      public void writePrivateData(@Nullable MemorySegment @Nullable [] privateData, Arena _arena)
      Write a value in the field private_data.
      Parameters:
      privateData - The new value for the field private_data
    • initAt

      public static boolean initAt(BitsetIter iter, Bitset set, int target, @Nullable Out<Integer> value)

      Initializes iter to point to target.

      If target is not found, finds the next value after it. If no value >= target exists in set, this function returns false.

      Parameters:
      iter - a pointer to an uninitialized GtkBitsetIter
      set - a GtkBitset
      target - target value to start iterating at
      value - Set to the found value in set
      Returns:
      true if a value was found.
    • initFirst

      public static boolean initFirst(BitsetIter iter, Bitset set, @Nullable Out<Integer> value)

      Initializes an iterator for set and points it to the first value in set.

      If set is empty, false is returned and value is set to G_MAXUINT.

      Parameters:
      iter - a pointer to an uninitialized GtkBitsetIter
      set - a GtkBitset
      value - Set to the first value in set
      Returns:
      true if set isn't empty.
    • initLast

      public static boolean initLast(BitsetIter iter, Bitset set, @Nullable Out<Integer> value)

      Initializes an iterator for set and points it to the last value in set.

      If set is empty, false is returned.

      Parameters:
      iter - a pointer to an uninitialized GtkBitsetIter
      set - a GtkBitset
      value - Set to the last value in set
      Returns:
      true if set isn't empty.
    • getValue

      public int getValue()

      Gets the current value that this BitsetIter points to.

      If this BitsetIter is not valid and isValid() returns false, 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

      public boolean next(@Nullable Out<Integer> value)

      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

      public boolean previous(@Nullable Out<Integer> value)

      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