示例#1
0
        public static Primitive Aggregate(List <Primitive> propertyValues, PropertyAggregate aggregationType)
        {
            switch (aggregationType)
            {
            case PropertyAggregate.COUNT:
                return(ResolvePrimitive(propertyValues.Count));

            case PropertyAggregate.VALUE:
                return(ValueAggregator(propertyValues));

            case PropertyAggregate.SUM:
                return(SumAggregator(propertyValues));

            case PropertyAggregate.AVG:
                return(AverageAggregator(propertyValues));

            case PropertyAggregate.MIN:
                return(MinAggregator(propertyValues));

            case PropertyAggregate.MAX:
                return(MaxAggregator(propertyValues));

            default: throw new Exception("Unknown Aggregation type: " + aggregationType);
            }
        }
示例#2
0
 public AggregatePropertyVariable(PropertyAggregate aggregationType, EntityProvider entityProvider, PropertySupplier property, Direction?direction)
 {
     this.aggregationType = aggregationType;
     this.entityProvider  = entityProvider;
     this.property        = property;
     this.direction       = direction;
 }
示例#3
0
 public ListAggregateVariable(Variable list, PropertyAggregate agg)
 {
     expectedList = list;
     aggregation  = agg;
 }