I need to apply the OR (logical) operator to all elements in the arraylist. The problem is: List arrayAllergeni = new ArrayList<>();

ex.

arrayAllergeni[0] = {false, true,  false, true,  false, true,...
arrayAllergeni[1] = {false, false, false, false, false, false,....

the result is:
result_allergeni[] = {false, true, false, true, false, true,....

with this I fill the ArrayList:

List<boolean[]> arrayAllergeni = new ArrayList<>();
        for (int i = 0; i < rct.getComposizione().size(); i++) {
            boolean[] allergeni = rct.getComposizione().get(i).getAllergeni();
            arrayAllergeni.add(allergeni);
        }

and I wouldlike to obtain the total OR logic of the array, the result will be boolean[] result_allergeni how can do that? there is some special function or I need to evaluate all single array?

Related posts

Recent Viewed