Java examples for java.util:BitSet
BitSet shift Right
//package com.java2s; import java.util.BitSet; public class Main { public static void shiftRight(BitSet bs, int n) { for (int i = 0; i < bs.length() && i > -1; i = bs.nextSetBit(i + 1)) { bs.clear(i);/*w w w . j a va 2 s . co m*/ if (i > 0) bs.set(i - 1); } } }