Example usage for com.google.common.primitives Booleans countTrue

List of usage examples for com.google.common.primitives Booleans countTrue

Introduction

In this page you can find the example usage for com.google.common.primitives Booleans countTrue.

Prototype

@Beta
public static int countTrue(boolean... values) 

Source Link

Document

Returns the number of values that are true .

Usage

From source file:org.eyeseetea.malariacare.layout.utils.AutoTabInVisibilityState.java

public int countInvisible() {
    return Booleans.countTrue(Booleans.toArray(elementInvisibility.values()));
}

From source file:org.eyeseetea.malariacare.layout.utils.AutoTabInVisibilityState.java

/**
 * Get the number of elements that are hidden until a given position
 * @param position// ww  w  . jav a  2  s  .c  o m
 * @return number of elements hidden (true in elementInvisibility Map)
 */
private int getHiddenCountUpTo(int position) {
    boolean[] upper = Arrays.copyOfRange(Booleans.toArray(elementInvisibility.values()), 0, position + 1);
    return Booleans.countTrue(upper);
}