public int next ( int ele ) { int idx , bit , val ; idx = ele >> SHIFT ; bit = ele & MASK ; val = data [ idx ] >>> bit ; do { val >>>= 1 ; bit ++ ; if ( val == 0 ) { idx ++ ; if ( idx == data . length ) { return - 1 ; } val = data [ idx ] ; bit = 0 ; } } while ( ( val & 1 ) == 0 ) ; return ( idx << SHIFT ) + bit ; }
Gets the element following ele .