Interface ISortingSnapshot<T>

Type Parameters:
T - effectively immutable value type with stable equality and hash codes

@NonExtendable public interface ISortingSnapshot<T>
An immutable view of the visible values and ordering resolved from a sorting config.

Config edits and changes to the available values do not update this snapshot. Obtain a new snapshot from ISortingConfig.getSnapshot(java.util.Collection<T>) after either changes. Snapshots may be shared between threads, provided the values and the config's default comparator are safe to share.

Since:
0.6.10
  • Method Summary

    Modifier and Type
    Method
    Description
    Return a comparator using this snapshot's order.
    @Unmodifiable List<T>
    Return the duplicate-free visible values in their resolved order.
    boolean
    isVisible(T value)
    Return whether a value is visible in this snapshot, using value equality.
  • Method Details

    • getSortedValues

      @Unmodifiable List<T> getSortedValues()
      Return the duplicate-free visible values in their resolved order.
      Returns:
      an unmodifiable list of visible values
      Since:
      0.6.10
    • isVisible

      boolean isVisible(T value)
      Return whether a value is visible in this snapshot, using value equality.
      Parameters:
      value - value to check
      Returns:
      false for hidden values and values absent when the snapshot was created
      Since:
      0.6.10
    • getComparator

      Comparator<T> getComparator()
      Return a comparator using this snapshot's order. Visible values sort first in their resolved order. All other values, including hidden values, sort afterward using the config's default comparator.
      Returns:
      a comparator independent of subsequent config edits
      Since:
      0.6.10