Java Boolean to Long booleanToLong(boolean[] values)

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

Description

boolean To Long

License

Open Source License

Declaration

public static long[] booleanToLong(boolean[] values) 

Method Source Code

//package com.java2s;

public class Main {
    public static long[] booleanToLong(boolean[] values) {
        if (values == null) {
            return null;
        }/*from www  .ja  v a2 s.co m*/

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

Related

  1. booleanToLong(boolean b)
  2. booleanTolong(final boolean value)