Package ch.bailu.gtk.glib
Class HashTableIter
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.glib.HashTableIter
- All Implemented Interfaces:
PointerInterface
A GHashTableIter structure represents an iterator that can be used
to iterate over the elements of a #GHashTable. GHashTableIter
structures are typically allocated on the stack and then initialized
with g_hash_table_iter_init().
The iteration order of a #GHashTableIter over the keys/values in a hash
table is not defined.
to iterate over the elements of a #GHashTable. GHashTableIter
structures are typically allocated on the stack and then initialized
with g_hash_table_iter_init().
The iteration order of a #GHashTableIter over the keys/values in a hash
table is not defined.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClassHandler
int
boolean
Returns the #GHashTable associated with @iter.void
Initializes a key/value pair iterator and associates it with
@hash_table.void
remove()
Removes the key/value pair currently pointed to by the iterator
from its associated #GHashTable.void
Replaces the value currently pointed to by the iterator
from its associated #GHashTable.void
steal()
Removes the key/value pair currently pointed to by the
iterator from its associated #GHashTable, without calling
the key and value destroy functions.Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
DUMMY1
- See Also:
-
DUMMY2
- See Also:
-
DUMMY3
- See Also:
-
DUMMY4
- See Also:
-
DUMMY5
- See Also:
-
DUMMY6
- See Also:
-
-
Constructor Details
-
HashTableIter
-
HashTableIter
public HashTableIter()
-
-
Method Details
-
getClassHandler
-
getFieldDummy1
-
getFieldDummy2
-
getFieldDummy3
-
getFieldDummy4
public int getFieldDummy4() -
getFieldDummy5
public boolean getFieldDummy5() -
getFieldDummy6
-
getHashTable
Returns the #GHashTable associated with @iter.- Returns:
- the #GHashTable associated with @iter.
-
init
Initializes a key/value pair iterator and associates it with
@hash_table. Modifying the hash table after calling this function
invalidates the returned iterator.
The iteration order of a #GHashTableIter over the keys/values in a hash
table is not defined.
<!-- language="C" --> GHashTableIter iter; gpointer key, value; g_hash_table_iter_init (&iter, hash_table); while (g_hash_table_iter_next (&iter, &key, &value)) { // do something with key and value }
- Parameters:
hash_table
- a #GHashTable
-
remove
public void remove()Removes the key/value pair currently pointed to by the iterator
from its associated #GHashTable. Can only be called after
g_hash_table_iter_next() returned %TRUE, and cannot be called
more than once for the same key/value pair.
If the #GHashTable was created using g_hash_table_new_full(),
the key and value are freed using the supplied destroy functions,
otherwise you have to make sure that any dynamically allocated
values are freed yourself.
It is safe to continue iterating the #GHashTable afterward:<!-- language="C" --> while (g_hash_table_iter_next (&iter, &key, &value)) { if (condition) g_hash_table_iter_remove (&iter); }
-
replace
Replaces the value currently pointed to by the iterator
from its associated #GHashTable. Can only be called after
g_hash_table_iter_next() returned %TRUE.
If you supplied a @value_destroy_func when creating the
#GHashTable, the old value is freed using that function.- Parameters:
value
- the value to replace with
-
steal
public void steal()Removes the key/value pair currently pointed to by the
iterator from its associated #GHashTable, without calling
the key and value destroy functions. Can only be called
after g_hash_table_iter_next() returned %TRUE, and cannot
be called more than once for the same key/value pair.
-