United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4306897 : (coll) Add java.util.Arrays.binarySearch(a, key, fromIndex, toIndex)

Details
Type:
Enhancement
Submit Date:
2000-01-25
Status:
Closed
Updated Date:
2017-05-16
Project Name:
JDK
Resolved Date:
2006-04-29
Component:
core-libs
OS:
generic,linux,windows_nt
Sub-Component:
java.util:collections
CPU:
generic,x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.3.0,1.4.0,6
Fixed Versions:

Related Reports
Relates:

Sub Tasks

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
                                     
2006-03-15
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)
======================================================================
                                     
2004-09-08
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
                                     
2000-01-26



Hardware and Software, Engineered to Work Together