Java Boolean to Int booleanToInt(boolean[] values)

Here you can find the source of booleanToInt(boolean[] values)

Description

boolean To Int

License

Open Source License

Declaration

public static int[] booleanToInt(boolean[] values) 

Method Source Code

//package com.java2s;

public class Main {
    public static int[] booleanToInt(boolean[] values) {
        if (values == null) {
            return null;
        }// www  .ja va2s . c o  m

        int[] results = new int[values.length];
        for (int i = 0; i < values.length; i++) {
            results[i] = (values[i] == true ? 1 : 0);
        }
        return results;
    }
}

Related

  1. boolean2int(String tmp)
  2. booleanToint(final boolean value)
  3. booleanToInteger(boolean b)
  4. BooleanToInteger(boolean thisbool)
  5. boolToInt(boolean b)