ReverseOrder

class ReverseOrder<T>(base: Order<T>) : Order<T>

A decorator class that reverses the order of a given Order.

This class takes an existing Order instance and provides a new Order that sorts elements in the opposite direction.

Type Parameters

T

The type of objects that this Order can compare.

Constructors

Link copied to clipboard
constructor(base: Order<T>)

Functions

Link copied to clipboard
open override fun compare(first: T, second: T): Int