use of org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.TDSAggregateValue in project legend-engine by finos.
the class Handlers method aggInference.
public static void aggInference(Object obj, GenericType gt, int mapOffset, int aggOffset, CompileContext cc, MutableList<String> ov, ProcessingContext pc) {
Lambda aggFirstLambda = null;
Lambda aggSecondLambda = null;
if (obj instanceof AppliedFunction) {
aggFirstLambda = ((Lambda) ((AppliedFunction) obj).parameters.get(mapOffset));
aggSecondLambda = ((Lambda) ((AppliedFunction) obj).parameters.get(aggOffset));
} else if (obj instanceof AggregateValue) {
aggFirstLambda = ((AggregateValue) obj).mapFn;
aggSecondLambda = ((AggregateValue) obj).aggregateFn;
} else if (obj instanceof TDSAggregateValue) {
aggFirstLambda = ((TDSAggregateValue) obj).mapFn;
aggSecondLambda = ((TDSAggregateValue) obj).aggregateFn;
}
if (aggFirstLambda != null && aggSecondLambda != null) {
updateSimpleLambda(aggFirstLambda, gt, new org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity(1, 1));
ValueSpecification processLambda = aggFirstLambda.accept(new ValueSpecificationBuilder(cc, ov, pc));
updateSimpleLambda(aggSecondLambda, funcReturnType(processLambda, cc.pureModel), new org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity());
}
}
Aggregations