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

Sorted List binarySearch functions #542

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kvr000
Copy link

@kvr000 kvr000 commented Sep 13, 2024

Based on PR for commons-lang3 apache/commons-lang#1270

There is Collections.binarySearch() in Java core. However, it searches for exact element which is often not usable, as the elements are typically sorted by particular field.

These methods introduce binarySearch() on (sorted) List, with ability to provide sorting key extraction function and key comparator.

The rest of semantics, behavior, parameters and return values remain consistent with Collections.binarySearch() from Java core.

@garydgregory
Copy link
Member

@kvr000
Please only provide only one binarySearch() API in this PR, like ArrayUtils in Commons Lang, no First/Last API.

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

Successfully merging this pull request may close these issues.

2 participants