public EventBean GetValueEventBean(
            int aggColNum,
            AggregationRow row,
            EventBean[] eventsPerStream,
            bool isNewData,
            ExprEvaluatorContext exprEvaluatorContext)
        {
            AggregationStateSorted sorted = (AggregationStateSorted)row.GetAccessState(aggColNum);

            return(_event.Invoke(sorted));
        }
        public object GetValue(
            int aggColNum,
            AggregationRow row,
            EventBean[] eventsPerStream,
            bool isNewData,
            ExprEvaluatorContext exprEvaluatorContext)
        {
            AggregationStateSorted sorted = (AggregationStateSorted)row.GetAccessState(aggColNum);
            var fromKey = _fromKeyEval.Evaluate(eventsPerStream, isNewData, exprEvaluatorContext);

            if (fromKey == null)
            {
                return(null);
            }

            var fromInclusive = _fromInclusiveEval.Evaluate(eventsPerStream, isNewData, exprEvaluatorContext).AsBoxedBoolean();

            if (fromInclusive == null)
            {
                return(null);
            }

            var toKey = _toKeyEval.Evaluate(eventsPerStream, isNewData, exprEvaluatorContext);

            if (toKey == null)
            {
                return(null);
            }

            var toInclusive = _toInclusiveEval.Evaluate(eventsPerStream, isNewData, exprEvaluatorContext).AsBoxedBoolean();

            if (toInclusive == null)
            {
                return(null);
            }

            var mapOfArrays = new OrderedListDictionary <object, object>(sorted.Sorted.KeyComparer);
            var submap      = sorted.Sorted.Between(fromKey, fromInclusive.Value, toKey, toInclusive.Value);

            foreach (KeyValuePair <object, object> entry in submap)
            {
                mapOfArrays.Put(entry.Key, AggregatorAccessSortedImpl.CheckedPayloadGetUnderlyingArray(entry.Value, _underlyingClass));
            }

            return(mapOfArrays);
        }