Java Boolean to Int boolToInt(Boolean[] bools_in)

Here you can find the source of boolToInt(Boolean[] bools_in)

Description

bool To Int

License

Open Source License

Declaration

public static int boolToInt(Boolean[] bools_in) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int boolToInt(Boolean[] bools_in) {
        // Returns a boolean array representing the integer
        // Works on a 24 bit unsigned integer
        int int_out;
        int_out = 0;
        for (int ii = 0; ii < bools_in.length; ii++) {
            if (bools_in[ii]) {
                int_out += Math.pow(2, ii);
            }//from w  w w. j  a v  a  2 s  . c  o m
        }
        return int_out;
    }
}

Related

  1. BooleanToInteger(boolean thisbool)
  2. boolToInt(boolean b)
  3. boolToInt(boolean b)
  4. boolToInt(boolean bool)
  5. BoolToInt(boolean Expression)
  6. convertBooleanToInt(boolean aValue)
  7. convertBooleanToInt(boolean bool)
  8. convertBooleanToInteger(Boolean booleanToConvert)