Code example for BitSet

Methods: nextSetBit

0
     */ 
    public void init(final int theOffset, final BitSet theContents) {
        super.init(); 
        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. 
     */ 
    @Override 
    public boolean hasNext() { 
        return nextValue >= 0;
    } 
 
    /**