use of org.activityinfo.model.query.ConstantColumnView in project activityinfo by bedatadriven.
the class SearchFunction method columnApply.
@Override
public ColumnView columnApply(int numRows, List<ColumnView> arguments) {
ColumnView substring = arguments.get(0);
ColumnView string = arguments.get(1);
ColumnView startIndex;
if (arguments.size() == 3) {
startIndex = arguments.get(3);
} else {
startIndex = new ConstantColumnView(numRows, 1d);
}
double[] result = new double[numRows];
for (int i = 0; i < numRows; i++) {
result[i] = apply(substring.getString(i), string.getString(i), startIndex.getDouble(i));
}
return new DoubleArrayColumnView(result);
}
Aggregations