public static BitSet getAt ( BitSet self , IntRange range ) { RangeInfo info = subListBorders ( self . length ( ) , range ) ; BitSet result = new BitSet ( ) ; int numberOfBits = info . to - info . from ; int adjuster = 1 ; int offset = info . from ; if ( info . reverse ) { adjuster = - 1 ; offset = info . to - 1 ; } for ( int i = 0 ; i < numberOfBits ; i ++ ) { result . set ( i , self . get ( offset + ( adjuster * i ) ) ) ; } return result ; }
Support retrieving a subset of a BitSet using a Range