use of org.hisp.dhis.expression.ExpressionInfo in project dhis2-core by dhis2.
the class VectorFunction method getExpressionInfo.
@Override
public Object getExpressionInfo(ExprContext ctx, CommonExpressionVisitor visitor) {
for (int i = 0; i < ctx.expr().size() - 1; i++) {
visitor.visitExpr(ctx.expr().get(i));
}
// ItemIds in the last (or only) expr are from sampled periods.
ExpressionInfo info = visitor.getInfo();
Set<DimensionalItemId> savedItemIds = info.getItemIds();
info.setItemIds(info.getSampleItemIds());
Object result = visitor.visitExpr(ctx.expr().get(ctx.expr().size() - 1));
info.setItemIds(savedItemIds);
return castDouble(result);
}
Aggregations