reverse method

  1. @useResult
Comparator<T> reverse()

Reverses the ordering of this Comparator.

final Comparator<int> compare = (a, b) => a.compareTo(b);

compare(1, 2); // -1;

compare.reverse()(1, 2); // 1

Implementation

@useResult Comparator<T> reverse() => (a, b) => this(a, b) * -1;