Code example for BitSet

Methods: nextSetBit

    public void init(final int theOffset, final BitSet theContents) {
        this.contents = theContents;
        this.offset = theOffset;
        nextValue = theContents.nextSetBit(0);
     * Returns <tt>true</tt> if the iteration has more elements. (In other 
     * words, returns <tt>true</tt> if <tt>next</tt> would return an element 
     * rather than throwing an exception.) 
     * @return <tt>true</tt> if the iterator has more elements. 
    public boolean hasNext() { 
        return nextValue >= 0;
Connect your IDE to all the code out there  Get Codota for Java