Java Integer to Boolean intToBool(int int_in, int length)

Here you can find the source of intToBool(int int_in, int length)

Description

int To Bool

License

Open Source License

Declaration

public static Boolean[] intToBool(int int_in, int length) 

Method Source Code

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

public class Main {
    public static Boolean[] intToBool(int int_in, int length) {
        Boolean[] boolarray_out = new Boolean[length];
        for (int ii = 0; ii < length; ii++) {
            boolarray_out[ii] = ((int_in % 2) == 1);
        }/*from   w ww.  jav  a  2 s.  c  o  m*/
        return boolarray_out;
    }

    public static Boolean[] intToBool(int int_in) {
        // TODO: If this gets a value too large, it won't work!
        return intToBool(int_in, (int) Math.floor(Math.log(int_in)));
    }
}

Related

  1. convertIntToBoolean(int value)
  2. IntegerToboolean(final Integer value)
  3. integerToStrBool(Integer integer)
  4. IntToBool(int Expression)
  5. intToBool(int i)
  6. intToBoolAra(int num, int len)
  7. intToBoolean(int x)
  8. intToBoolean(int[] values)
  9. intToBoolean(Integer value)