public Object EvaluateEnumMethod(EventBean[] eventsLambda, ICollection <object> target, bool isNewData, ExprEvaluatorContext context)
        {
            var items  = new LinkedHashMap <Object, int?>();
            var values = target;

            var resultEvent = new ObjectArrayEventBean(new Object[1], _resultEventType);

            foreach (Object next in values)
            {
                resultEvent.Properties[0]     = next;
                eventsLambda[StreamNumLambda] = resultEvent;

                var item = InnerExpression.Evaluate(new EvaluateParams(eventsLambda, isNewData, context));

                int?existing;
                if (!items.TryGetValue(item, out existing))
                {
                    existing = 1;
                }
                else
                {
                    existing++;
                }
                items.Put(item, existing);
            }

            return(EnumEvalMostLeastFrequentEvent.GetResult(items, _isMostFrequent));
        }
Exemple #2
0
        public object EvaluateEnumMethod(EventBean[] eventsLambda, ICollection <object> target, bool isNewData, ExprEvaluatorContext context)
        {
            IDictionary <Object, int?> items = new LinkedHashMap <Object, int?>();

            foreach (Object next in target)
            {
                int?existing = items.Get(next);
                if (existing == null)
                {
                    existing = 1;
                }
                else
                {
                    existing++;
                }
                items.Put(next, existing);
            }

            return(EnumEvalMostLeastFrequentEvent.GetResult(items, _isMostFrequent));
        }