Java BitSet toInteger(final BitSet bits)

Here you can find the source of toInteger(final BitSet bits)

Description

to Integer

License

Open Source License

Declaration

public static int toInteger(final BitSet bits) 

Method Source Code


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

public class Main {
    public static int toInteger(final BitSet bits) {
        int value = 0;
        for (int i = 0; i < 32; ++i) {
            value += bits.get(i) ? (1 << i) : 0;
        }// w w  w.j  a  va2  s . c o m
        return value;
    }
}

Related

  1. toByteArray(BitSet bs, int length)
  2. toFixedLengthByteArray(BitSet bs, int length)
  3. toggleInPlace(BitSet a, BitSet b)
  4. toInt(BitSet bitSet)
  5. toIntArray(final BitSet bits, final int size)
  6. toLong(final BitSet value)
  7. toString(BitSet bs)
  8. translateBitSetToProjIndx(BitSet projBitSet)
  9. unionAdd(BitSet newClique, int nNodes, LinkedList cliques)