Java Boolean Array And ANDWith(boolean[] toChange, boolean[] toAdd)

Here you can find the source of ANDWith(boolean[] toChange, boolean[] toAdd)

Description

AND With

License

LGPL

Declaration

public static void ANDWith(boolean[] toChange, boolean[] toAdd) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static void ANDWith(boolean[] toChange, boolean[] toAdd) {
        if (toChange.length != toAdd.length)
            throw new IllegalArgumentException("Array sizes have to be equal.");

        for (int i = 0; i < toAdd.length; i++) {
            toChange[i] = toAdd[i] && toChange[i];
        }/* w w  w.  j a  va  2 s . c o  m*/
    }
}

Related

  1. and(boolean a[], boolean b[])
  2. and(boolean[] x, boolean[] y)
  3. and(boolean[][] b1, boolean[][] b2)
  4. andRows(boolean[][] data)