JDK-6505531 : Add BitSet.prevSetBit, BitSet.prevClearBit
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-12-18
  • Updated: 2011-02-16
  • Resolved: 2006-12-18
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE REQUEST :
The BitSet methods nextSetBit and nextClearBit perform much better than what can be done otherwise using the public interface. But the opposite methods are missing, ie, prevSetBit, prevClearBit. We implement them from outside the class, but the performance drop off is significant. Please consider adding these.

JUSTIFICATION :
We use BitSet to represent work/non worktime in a day, and perform millions of calculations to figure out when the start/finish of work/non work time is. Finding the 'next' time is very performant, using nextClearBit/nextSetBit, but finding the previous times are much slower.

Comments
EVALUATION Oops.... Just noticed existing RFE 6410729: Add BitSet.previousClearBit, previousSetBit Closing this one as a dup.
18-12-2006

EVALUATION A reasonable request. Implementation should be obvious, given the existing methods. The conceptual weight of the API would not be increased.
18-12-2006