use of org.activityinfo.model.query.BooleanColumnView in project activityinfo by bedatadriven.
the class BinaryBooleanOperator method columnApply.
@Override
public ColumnView columnApply(int numRows, List<ColumnView> arguments) {
checkArity(arguments, 2);
ColumnView a = arguments.get(0);
ColumnView b = arguments.get(1);
if (a.numRows() != b.numRows()) {
throw new FormulaSyntaxException("Arguments must have the same number of rows");
}
int[] result = new int[a.numRows()];
for (int i = 0; i < result.length; i++) {
int ai = a.getBoolean(i);
int bi = b.getBoolean(i);
result[i] = apply(ai, bi);
}
return new BooleanColumnView(result);
}
Aggregations