Package io.github.jwharm.javagi.gio
Class ListIndexModel
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.gobject.TypeInstance
org.gnome.gobject.GObject
io.github.jwharm.javagi.gio.ListIndexModel
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Small GObject-derived class with a numeric "index" field.Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.Builder<B extends GObject.Builder<B>>, GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gio.ListModel
ListModel.ItemsChangedCallback, ListModel.ListModelImpl, ListModel.ListModelInterface
Nested classes/interfaces inherited from interface io.github.jwharm.javagi.gio.ListModelJavaList
ListModelJavaList.SubList<E extends GObject,
List extends ListModelJavaList<E>> -
Constructor Summary
ConstructorDescriptionListIndexModel
(MemorySegment address) Construct a ListIndexModel for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptiongetItem
(int position) Returns aListIndexModel.ListIndex
with the requested position as its value.Get the gtype ofListIndexModel.ListIndex
.int
Get the size of the list model.static Type
getType()
Return the GType for the ListIndexModel.static ListIndexModel
newInstance
(int size) Construct a new ListIndexModel with the provided size.void
setItemType
(Type itemType) No-op.void
setSize
(int size) Set the size field to the provided value, and emit the "items-changed" signal.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, asParent, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, builder, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addFirst, addLast, equals, getFirst, getLast, hashCode, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
Methods inherited from interface org.gnome.gio.ListModel
emitItemsChanged, itemsChanged, onItemsChanged
Methods inherited from interface io.github.jwharm.javagi.gio.ListModelJavaList
add, add, addAll, addAll, clear, contains, containsAll, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
-
Constructor Details
-
ListIndexModel
Construct a ListIndexModel for the provided memory address.- Parameters:
address
- the memory address of the instance in native memory
-
-
Method Details
-
getType
-
newInstance
Construct a new ListIndexModel with the provided size.- Parameters:
size
- the initial size of the list model
-
setSize
public void setSize(int size) Set the size field to the provided value, and emit the "items-changed" signal.- Parameters:
size
- the new list model size
-
getItemType
Get the gtype ofListIndexModel.ListIndex
.- Specified by:
getItemType
in interfaceListModel<ListIndexModel.ListIndex>
- Returns:
- always returns the value of
ListIndexModel.ListIndex.gtype
-
setItemType
No-op. The item type is alwaysListIndexModel.ListIndex.gtype
.- Parameters:
itemType
- ignored
-
getNItems
public int getNItems()Get the size of the list model.- Specified by:
getNItems
in interfaceListModel<ListIndexModel.ListIndex>
- Specified by:
getNItems
in interfaceListModelJavaList<ListIndexModel.ListIndex>
- Returns:
- the value of the size field
-
getItem
Returns aListIndexModel.ListIndex
with the requested position as its value.- Specified by:
getItem
in interfaceListModel<ListIndexModel.ListIndex>
- Specified by:
getItem
in interfaceListModelJavaList<ListIndexModel.ListIndex>
- Parameters:
position
- the position of the item to fetch- Returns:
- a
ListIndexModel.ListIndex
with the requested position as its value
-