Package ch.bailu.gtk.gio
Class ListStore
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gio.ListStore
- All Implemented Interfaces:
PointerInterface
#GListStore is a simple implementation of #GListModel that stores all
items in memory.
It provides insertions, deletions, and lookups in logarithmic time
with a fast path for the common case of iterating the list linearly.
items in memory.
It provides insertions, deletions, and lookups in logarithmic time
with a fast path for the common case of iterating the list linearly.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
ConstructorDescriptionListStore
(long item_type) Creates a new #GListStore with items of type @item_type.ListStore
(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Appends @item to @store.Implements interfaceListModel
.static ClassHandler
static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
void
Inserts @item into @store at @position.int
insertSorted
(Pointer item, ListStore.OnCompareDataFunc compare_func, Pointer user_data) Inserts @item into @store at a position to be determined by the
@compare_func.void
remove
(int position) Removes the item from @store that is at @position.void
Removes all items from @store.void
sort
(ListStore.OnCompareDataFunc compare_func, Pointer user_data) Sort the items in @store according to @compare_func.Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
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
-
Constructor Details
-
ListStore
-
ListStore
public ListStore(long item_type) Creates a new #GListStore with items of type @item_type. @item_type
must be a subclass of #GObject.- Parameters:
item_type
- the #GType of items in the list
-
-
Method Details
-
getClassHandler
-
append
Appends @item to @store. @item must be of type #GListStore:item-type.
This function takes a ref on @item.
Use g_list_store_splice() to append multiple items at the same time
efficiently.- Parameters:
item
- the new item
-
insert
Inserts @item into @store at @position. @item must be of type
#GListStore:item-type or derived from it. @position must be smaller
than the length of the list, or equal to it to append.
This function takes a ref on @item.
Use g_list_store_splice() to insert multiple items at the same time
efficiently.- Parameters:
position
- the position at which to insert the new itemitem
- the new item
-
insertSorted
public int insertSorted(@Nonnull Pointer item, ListStore.OnCompareDataFunc compare_func, @Nullable Pointer user_data) Inserts @item into @store at a position to be determined by the
@compare_func.
The list must already be sorted before calling this function or the
result is undefined. Usually you would approach this by only ever
inserting items by way of this function.
This function takes a ref on @item.- Parameters:
item
- the new itemcompare_func
- pairwise comparison function for sortinguser_data
- user data for @compare_func- Returns:
- the position at which @item was inserted
-
remove
public void remove(int position) Removes the item from @store that is at @position. @position must be
smaller than the current length of the list.
Use g_list_store_splice() to remove multiple items at the same time
efficiently.- Parameters:
position
- the position of the item that is to be removed
-
removeAll
public void removeAll()Removes all items from @store. -
sort
Sort the items in @store according to @compare_func.- Parameters:
compare_func
- pairwise comparison function for sortinguser_data
- user data for @compare_func
-
asListModel
Implements interfaceListModel
. Call this to get access to interface functions.- Returns:
ListModel
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-