Klasse ValueArray

Alle implementierten Schnittstellen:
PointerInterface

public class ValueArray extends Record
A `GValueArray` is a container structure to hold an array of generic values.

The prime purpose of a `GValueArray` is for it to be used as an
object property that holds an array of values. A `GValueArray` wraps
an array of `GValue` elements in order for it to be used as a boxed
type through `G_TYPE_VALUE_ARRAY`.

`GValueArray` is deprecated in favour of `GArray` since GLib 2.32.
It is possible to create a `GArray` that behaves like a `GValueArray`
by using the size of `GValue` as the element size, and by setting
[method@GObject.Value.unset] as the clear function using
[func@GLib.Array.set_clear_func], for instance, the following code:

```c
GValueArray *array = g_value_array_new (10);
```

can be replaced by:

```c
GArray *array = g_array_sized_new (FALSE, TRUE, sizeof (GValue), 10);
g_array_set_clear_func (array, (GDestroyNotify) g_value_unset);
```

https://docs.gtk.org/gobject/struct.ValueArray.html

  • Felddetails

  • Konstruktordetails

    • ValueArray

      public ValueArray(PointerContainer pointer)
    • ValueArray

      public ValueArray()
    • ValueArray

      @Deprecated public ValueArray(int n_prealloced)
      Veraltet.
      Allocate and initialize a new #GValueArray, optionally preserve space
      for @n_prealloced elements. New arrays always contain 0 elements,
      regardless of the value of @n_prealloced.
      Parameter:
      n_prealloced - number of values to preallocate space for
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • setFieldNValues

      public void setFieldNValues(int n_values)
      number of values contained in the array
    • getFieldNValues

      public int getFieldNValues()
      number of values contained in the array
    • setFieldValues

      public void setFieldValues(Value values)
      array of values
    • getFieldValues

      public Value getFieldValues()
      array of values
    • getFieldNPrealloced

      public int getFieldNPrealloced()
    • append

      @Deprecated public ValueArray append(@Nullable Value value)
      Veraltet.
      Insert a copy of @value as last element of @value_array. If @value is
      %NULL, an uninitialized value is appended.
      Parameter:
      value - #GValue to copy into #GValueArray, or %NULL
      Gibt zurück:
      the #GValueArray passed in as @value_array
    • copy

      @Deprecated public ValueArray copy()
      Veraltet.
      Construct an exact copy of a #GValueArray by duplicating all its
      contents.
      Gibt zurück:
      Newly allocated copy of #GValueArray
    • free

      @Deprecated public void free()
      Veraltet.
      Free a #GValueArray including its contents.
    • getNth

      @Deprecated public Value getNth(int index_)
      Veraltet.
      Return a pointer to the value at @index_ contained in @value_array.
      Parameter:
      index_ - index of the value of interest
      Gibt zurück:
      pointer to a value at @index_ in @value_array
    • insert

      @Deprecated public ValueArray insert(int index_, @Nullable Value value)
      Veraltet.
      Insert a copy of @value at specified position into @value_array. If @value
      is %NULL, an uninitialized value is inserted.
      Parameter:
      index_ - insertion position, must be <= value_array->;n_values
      value - #GValue to copy into #GValueArray, or %NULL
      Gibt zurück:
      the #GValueArray passed in as @value_array
    • prepend

      @Deprecated public ValueArray prepend(@Nullable Value value)
      Veraltet.
      Insert a copy of @value as first element of @value_array. If @value is
      %NULL, an uninitialized value is prepended.
      Parameter:
      value - #GValue to copy into #GValueArray, or %NULL
      Gibt zurück:
      the #GValueArray passed in as @value_array
    • remove

      @Deprecated public ValueArray remove(int index_)
      Veraltet.
      Remove the value at position @index_ from @value_array.
      Parameter:
      index_ - position of value to remove, which must be less than @value_array->n_values
      Gibt zurück:
      the #GValueArray passed in as @value_array
    • sort

      @Deprecated public ValueArray sort(ValueArray.OnCompareFunc compare_func)
      Veraltet.
      Sort @value_array using @compare_func to compare the elements according to
      the semantics of #GCompareFunc.

      The current implementation uses the same sorting algorithm as standard
      C qsort() function.
      Parameter:
      compare_func - function to compare elements
      Gibt zurück:
      the #GValueArray passed in as @value_array
    • sortWithData

      @Deprecated public ValueArray sortWithData(ValueArray.OnCompareDataFunc compare_func, @Nullable Pointer user_data)
      Veraltet.
      Sort @value_array using @compare_func to compare the elements according
      to the semantics of #GCompareDataFunc.

      The current implementation uses the same sorting algorithm as standard
      C qsort() function.
      Parameter:
      compare_func - function to compare elements
      user_data - extra data argument provided for @compare_func
      Gibt zurück:
      the #GValueArray passed in as @value_array
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()