Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where is Comparator.reversed()? #95

Closed
BattleShipPark opened this issue Feb 10, 2017 · 3 comments
Closed

Where is Comparator.reversed()? #95

BattleShipPark opened this issue Feb 10, 2017 · 3 comments

Comments

@BattleShipPark
Copy link

Hi,
I'd like to know where Comparator.reversed() is.
Thanks!

@aNNiMON
Copy link
Owner

aNNiMON commented Feb 10, 2017

@BattleShipPark there is no backported methods of Comparator. But it's an idea to backport them. Thanks!

@aNNiMON
Copy link
Owner

aNNiMON commented Feb 12, 2017

@BattleShipPark you can use Collections.reverseOrder(comparator). It has been intruduced in Java 1.5 and exists in Android API level 1.

Since default methods are introduced in Java 8, I can only create something like ComparatorCompat.reversed(comparator) instead of comparator.reversed(). So, for reversed order, please, use Collections class.

Other Comparator's methods, such as thenComparing, comparing, etc, I will implement soon.

@aNNiMON aNNiMON closed this as completed Feb 12, 2017
@BattleShipPark
Copy link
Author

I will be waiting for them. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants