Class MultiSorter

All Implemented Interfaces:
Iterable<Sorter>, Collection<Sorter>, List<Sorter>, SequencedCollection<Sorter>, ListModel<Sorter>, Buildable, Proxy, ListModelJavaList<Sorter>, ListModelJavaListMutable<Sorter>

@Generated("org.javagi.JavaGI") public class MultiSorter extends Sorter implements ListModel<Sorter>, Buildable, ListModelJavaListMutable<Sorter>

Combines multiple sorters by trying them in turn.

If the first sorter compares two items as equal, the second is tried next, and so on.

  • Constructor Details

    • MultiSorter

      public MultiSorter(MemorySegment address)
      Create a MultiSorter instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • MultiSorter

      public MultiSorter()
      Create a new MultiSorter.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the MultiSorter class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected MultiSorter asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class Sorter
      Returns:
      the instance as if it were its parent type
    • append

      public void append(Sorter sorter)

      Add sorter to this MultiSorter to use for sorting at the end.

      this MultiSorter will consult all existing sorters before it will sort with the given sorter.

      Specified by:
      append in interface ListModelJavaListMutable<Sorter>
      Parameters:
      sorter - a sorter to add
    • removeAt

      public void removeAt(int position)

      Removes the sorter at the given position from the list of sorter used by self.

      If position is larger than the number of sorters, nothing happens.

      Specified by:
      removeAt in interface ListModelJavaListMutable<Sorter>
      Parameters:
      position - position of sorter to remove
    • builder

      public static MultiSorter.Builder<? extends MultiSorter.Builder> builder()
      A MultiSorter.Builder object constructs a MultiSorter with the specified properties. Use the various set...() methods to set properties, and finish construction with MultiSorter.Builder.build().
      Returns:
      the builder object