Package ch.bailu.gtk.gobject
Klasse ValueArray
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.gobject.ValueArray
- Alle implementierten Schnittstellen:
PointerInterface
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);
```
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);
```
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interface
static interface
-
Feldübersicht
Felder -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungValueArray
(int n_prealloced) Veraltet.ValueArray
(PointerContainer pointer) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungVeraltet.copy()
Veraltet.void
free()
Veraltet.static ClassHandler
int
int
number of values contained in the arrayarray of valuesstatic int
getNth
(int index_) Veraltet.static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
Veraltet.Veraltet.remove
(int index_) Veraltet.void
setFieldNValues
(int n_values) number of values contained in the arrayvoid
setFieldValues
(Value values) array of valuessort
(ValueArray.OnCompareFunc compare_func) Veraltet.sortWithData
(ValueArray.OnCompareDataFunc compare_func, Pointer user_data) Veraltet.Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
N_VALUES
number of values contained in the array- Siehe auch:
-
VALUES
array of values- Siehe auch:
-
N_PREALLOCED
- Siehe auch:
-
-
Konstruktordetails
-
ValueArray
-
ValueArray
public ValueArray() -
ValueArray
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
-
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
array of values -
getFieldValues
array of values -
getFieldNPrealloced
public int getFieldNPrealloced() -
append
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
Veraltet.Construct an exact copy of a #GValueArray by duplicating all its
contents.- Gibt zurück:
- Newly allocated copy of #GValueArray
-
free
Veraltet.Free a #GValueArray including its contents. -
getNth
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
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_valuesvalue
- #GValue to copy into #GValueArray, or %NULL- Gibt zurück:
- the #GValueArray passed in as @value_array
-
prepend
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
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
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 elementsuser_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
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-