List of usage examples for java.util BitSet previousSetBit
public int previousSetBit(int fromIndex)
From source file:Main.java
public static void main(String[] args) { BitSet bitset1 = new BitSet(8); // assign values to bitset1 bitset1.set(0);//from w w w .java2 s . c om bitset1.set(1); bitset1.set(2); // print the sets System.out.println("Bitset1:" + bitset1.previousSetBit(1)); }
From source file:Test.java
public static void main(String[] args) { BitSet bitSet = new BitSet(); long[] array = { 1, 2, 3 }; bitSet = BitSet.valueOf(array); System.out.println(bitSet);//from w w w. j a v a 2 s . com long[] tmp = bitSet.toLongArray(); for (long number : tmp) { System.out.println(number); } System.out.println(bitSet.previousSetBit(1)); System.out.println(bitSet.previousClearBit(66)); }