Java BitSet shiftLeft(BitSet bs, int n)

Here you can find the source of shiftLeft(BitSet bs, int n)

Description

shift Left

License

Open Source License

Declaration

public static void shiftLeft(BitSet bs, int n) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.BitSet;

public class Main {
    public static void shiftLeft(BitSet bs, int n) {
        for (int i = bs.length() - 1; i >= 0; i = bs.previousSetBit(i - 1)) {
            bs.clear(i);/*  w w  w .j  a v a2  s .  c  om*/
            bs.set(i + 1);
        }
    }
}

Related

  1. reverse(final BitSet bitset, final int sizeInBits)
  2. reverseBitSet(BitSet bs)
  3. setBitIterator(final BitSet b)
  4. setBits(BitSet bitSet, Iterable indexes)
  5. setBitSet(BitSet bitSet, int x1, int x2, int y, int width)
  6. shiftLeft(BitSet s, int length)
  7. shiftLeft(BitSet src, int offset)
  8. shiftRight(BitSet bitset, int n)
  9. storeCharSet(BitSet stored, String... validCharStrings)