Class NumericSorter

All Implemented Interfaces:
PointerInterface

public class NumericSorter extends Sorter
`GtkNumericSorter` is a `GtkSorter` that compares numbers.

To obtain the numbers to compare, this sorter evaluates a
[class@Gtk.Expression].

https://docs.gtk.org/gtk4/class.NumericSorter.html

  • Constructor Details

    • NumericSorter

      public NumericSorter(PointerContainer pointer)
    • NumericSorter

      public NumericSorter(@Nullable Expression expression)
      Creates a new numeric sorter using the given @expression.

      Smaller numbers will be sorted first. You can call
      [method@Gtk.NumericSorter.set_sort_order] to change this.
      Parameters:
      expression - The expression to evaluate
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getExpression

      public Expression getExpression()
      Gets the expression that is evaluated to obtain numbers from items.
      Returns:
      a `GtkExpression`
    • getSortOrder

      public int getSortOrder()
      Gets whether this sorter will sort smaller numbers first.
      Returns:
      the order of the numbers
    • setExpression

      public void setExpression(@Nullable Expression expression)
      Sets the expression that is evaluated to obtain numbers from items.

      Unless an expression is set on @self, the sorter will always
      compare items as invalid.

      The expression must have a return type that can be compared
      numerically, such as %G_TYPE_INT or %G_TYPE_DOUBLE.
      Parameters:
      expression - a `GtkExpression`
    • setSortOrder

      public void setSortOrder(int sort_order)
      Sets whether to sort smaller numbers before larger ones.
      Parameters:
      sort_order - whether to sort smaller numbers first
    • 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()