BitSet not operation - Java java.util

Java examples for java.util:BitSet

Description

BitSet not operation

Demo Code


//package com.java2s;
import java.util.BitSet;

public class Main {
    public static void not(BitSet bs) {
        for (int i = 0; i < bs.length(); i++) {
            if (bs.get(i))
                bs.clear(i);/*from   w  ww  .  j a  v  a  2s .  c  o  m*/
            else
                bs.set(i);
        }
    }
}

Related Tutorials