Here you can find the source of shiftLeft(BitSet s, int length)
Parameter | Description |
---|---|
s | Shifted BitSet object. |
length | Length of binary number. |
public static BitSet shiftLeft(BitSet s, int length)
//package com.java2s; //License from project: Open Source License import java.util.BitSet; public class Main { /**//from w w w .jav a 2 s .c o m * Shifts bits of a BitSet object one place to the left. * Stores new value in the same BitSet. * * @param s Shifted BitSet object. * @param length Length of binary number. * @return BitSet s after shifting. */ public static BitSet shiftLeft(BitSet s, int length) { for (int i = length; i > 0; i--) { s.set(i, s.get(i - 1)); } s.set(0, false); return s; } }