Added in API level 1

DisplayNameComparator


open class DisplayNameComparator : Comparator<PackageItemInfo!>

Summary

Public constructors

Public methods
Int

Inherited functions
Comparator<T>! reversed()

Returns a comparator that imposes the reverse ordering of this comparator.

Comparator<T>! thenComparing(other: Comparator<in T>!)

Returns a lexicographic-order comparator with another comparator. If this Comparator considers two elements equal, i.e. compare(a, b) == 0, other is used to determine the order.

The returned comparator is serializable if the specified comparator is also serializable.

Comparator<T>! thenComparing(keyExtractor: Function<in T, out U>!)

Returns a lexicographic-order comparator with a function that extracts a Comparable sort key.

Comparator<T>! thenComparing(keyExtractor: Function<in T, out U>!, keyComparator: Comparator<in U>!)

Returns a lexicographic-order comparator with a function that extracts a key to be compared with the given Comparator.

Comparator<T>! thenComparingDouble(keyExtractor: ToDoubleFunction<in T>!)

Returns a lexicographic-order comparator with a function that extracts a double sort key.

Comparator<T>! thenComparingInt(keyExtractor: ToIntFunction<in T>!)

Returns a lexicographic-order comparator with a function that extracts an int sort key.

Comparator<T>! thenComparingLong(keyExtractor: ToLongFunction<in T>!)

Returns a lexicographic-order comparator with a function that extracts a long sort key.

Public constructors

DisplayNameComparator

Added in API level 1
DisplayNameComparator(pm: PackageManager!)

Public methods

compare

Added in API level 1
fun compare(
    aa: PackageItemInfo!,
    ab: PackageItemInfo!
): Int
Parameters
o1 the first object to be compared.
o2 the second object to be compared.
Return
Int a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
Exceptions
java.lang.NullPointerException if an argument is null and this comparator does not permit null arguments
java.lang.ClassCastException if the arguments' types prevent them from being compared by this comparator.