JDK-4306897 : (coll) Add java.util.Arrays.binarySearch(a, key, fromIndex, toIndex)
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 1.3.0,1.4.0,6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,linux,windows_nt
  • CPU: generic,x86
  • Submitted: 2000-01-25
  • Updated: 2017-05-16
  • Resolved: 2006-04-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b83Fixed
Related Reports
Relates :  
Description
Name: krT82822			Date: 01/24/2000


java version "1.2.2"
Classic VM (build JDK-1.2.2-W, native threads, symcjit)

Since it is possible to sort a part of the array, it should be possible to
search a part of the array.

In my case, I created an empty Object array which is gradually filled in, but
not always to capacity. I can sort the filled entries, but I can't search
through them without copying them first to a new array, which I'd rather not do
for performance reasons.

Modyfing binarySearch to acommodate this feature is trivial.
(Review ID: 100004) 
======================================================================

Comments
EVALUATION Contribution-Forum:https://jdk-collaboration.dev.java.net/servlets/ProjectForumMessageView?messageID=11999&forumID=1463
15-03-2006

WORK AROUND Name: jl125535 Date: 01/10/2002 CUSTOMER WORKAROUND : Copy your contents into a new array, then search on that array. You have to do this because Arrays.binarySearch() can't take arrays that aren't full. (Review ID: 138057) ======================================================================
08-09-2004

EVALUATION This might be useful. Unfortunately it would involve adding methods for each primitive type as well. michael.mccloskey@eng 2000-01-26 This gap in the API is worth filling. ###@###.### 2005-06-15 17:37:26 GMT
26-01-2000