Java BitSet shiftLeft(BitSet src, int offset)

Here you can find the source of shiftLeft(BitSet src, int offset)

Description

shift Left

License

Apache License

Declaration

public static BitSet shiftLeft(BitSet src, int offset) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.BitSet;

public class Main {
    public static BitSet shiftLeft(BitSet src, int offset) {
        if (offset < 0)
            return src;
        BitSet result = new BitSet();

        int i;/*from   w w  w.  j a va  2s  . co  m*/
        for (i = 0; i < src.length(); i++) {
            if (src.get(i)) {
                result.set(i + offset, true);
            }
        }

        return result;
    }
}

Related

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