brettwooldridge / SparseBitSet

An efficient sparse bit set implementation for Java
Apache License 2.0
262 stars 33 forks source link

Request for previousSetBit and previousClearBit methods #7

Closed mbjarland closed 6 years ago

mbjarland commented 7 years ago

The java BitSet implementation has these as:

int previousClearBit(int fromIndex)
int previousSetBit(int fromIndex)

Many thanks for this excellent implementation. This is truly useful and a great addition to the JVM ecosystem of tools.

I started looking at creating a pull request but given the complexity of the implementation I backed out and figured I would ask the implementor for help first. Let me know if this would be feasible and if so, whether this is something you could envision adding.

lfbayer commented 6 years ago

The SparseBitSet-1.2 maven artifact has been published containing this enhancement. Thanks for the code!