kotlin.comparisons.java.util.Comparator.thenByDescending

thenByDescending

inline fun <T> Comparator<T>.thenByDescending(
    crossinline selector: (T) -> Comparable<*>?
): Comparator<T>

Platform and version requirements: JVM

Creates a descending comparator using the primary comparator and the function to transform value to a Comparable instance for comparison.

inline fun <T, K> Comparator<T>.thenByDescending(
    comparator: Comparator<in K>, 
    crossinline selector: (T) -> K
): Comparator<T>

Platform and version requirements: JVM

Creates a descending comparator comparing values after the primary comparator defined them equal. It uses the selector function to transform values and then compares them with the given comparator.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.comparisons/java.util.-comparator/then-by-descending.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部