Ejemplo n.º 1
0
 public CodegenExpression CodegenGetAccessTableState(
     int column,
     CodegenMethodScope parent,
     CodegenClassScope classScope)
 {
     return AggregatorAccessSortedImpl.CodegenGetAccessTableState(column, parent, classScope);
 }
        private static Array UnderlyingEvents(
            IDictionary <object, object> submap,
            Type underlyingClass)
        {
            if (submap.IsEmpty())
            {
                return(Arrays.CreateInstanceChecked(underlyingClass, 0));
            }

            ArrayDeque <EventBean> events = new ArrayDeque <EventBean>(4);

            foreach (KeyValuePair <object, object> entry in submap)
            {
                AggregatorAccessSortedImpl.CheckedPayloadAddAll(events, entry.Value);
            }

            var array = Arrays.CreateInstanceChecked(underlyingClass, events.Count);
            int index = 0;

            foreach (EventBean @event in events)
            {
                array.SetValue(@event.Underlying, index++);
            }

            return(array);
        }
 internal static object EventsArrayUnd(
     object value,
     Type underlyingClass)
 {
     return(value != null
                         ? AggregatorAccessSortedImpl.CheckedPayloadGetUnderlyingArray(value, underlyingClass)
                         : null);
 }
 public static IEnumerator <KeyValuePair <object, ICollection <EventBean> > > For(IEnumerator <KeyValuePair <object, object> > enumerator)
 {
     while (enumerator.MoveNext())
     {
         yield return(new KeyValuePair <object, ICollection <EventBean> >(
                          enumerator.Current.Key,
                          AggregatorAccessSortedImpl.CheckedPayloadGetCollEvents(enumerator.Current.Value)));
     }
 }
 internal static object EventsArrayUnd(
     KeyValuePair <object, object>?entry,
     Type underlyingClass)
 {
     return(entry != null
                         ? AggregatorAccessSortedImpl.CheckedPayloadGetUnderlyingArray(
                entry.Value.Value,
                underlyingClass)
                         : null);
 }
        private static ICollection <EventBean> CollEvents(IDictionary <object, object> submap)
        {
            if (submap.IsEmpty())
            {
                return(EmptyList <EventBean> .Instance);
            }

            ArrayDeque <EventBean> events = new ArrayDeque <EventBean>(4);

            foreach (KeyValuePair <object, object> entry in submap)
            {
                AggregatorAccessSortedImpl.CheckedPayloadAddAll(events, entry.Value);
            }

            return(events);
        }
        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);
        }
 public static IEnumerator<ICollection<EventBean>> For(IEnumerator<object> enumerator)
 {
     while (enumerator.MoveNext()) {
         yield return AggregatorAccessSortedImpl.CheckedPayloadGetCollEvents(enumerator.Current);
     }
 }
 internal static ICollection <EventBean> EventsColl(object value)
 {
     return(value != null
                         ? AggregatorAccessSortedImpl.CheckedPayloadGetCollEvents(value)
                         : null);
 }
 internal static ICollection <EventBean> EventsColl(KeyValuePair <object, object>?entry)
 {
     return(entry != null
                         ? AggregatorAccessSortedImpl.CheckedPayloadGetCollEvents(entry.Value.Value)
                         : null);
 }
 internal static ICollection <EventBean> FirstColl(object value)
 {
     return(value != null
                         ? Collections.SingletonList(AggregatorAccessSortedImpl.CheckedPayloadMayDeque(value))
                         : null);
 }
 internal static ICollection <EventBean> FirstColl(KeyValuePair <object, object>?entry)
 {
     return(entry != null
                         ? Collections.SingletonList(AggregatorAccessSortedImpl.CheckedPayloadMayDeque(entry.Value.Value))
                         : null);
 }
 internal static EventBean FirstBean(object value)
 {
     return(value != null
                         ? AggregatorAccessSortedImpl.CheckedPayloadMayDeque(value)
                         : null);
 }
 internal static EventBean FirstBean(KeyValuePair <object, object>?entry)
 {
     return(entry != null
                         ? AggregatorAccessSortedImpl.CheckedPayloadMayDeque(entry.Value.Value)
                         : null);
 }
 internal static object FirstUnd(object value)
 {
     return(value != null
                         ? AggregatorAccessSortedImpl.CheckedPayloadMayDeque(value).Underlying
                         : null);
 }
 internal static object FirstUnd(KeyValuePair <object, object>?entry)
 {
     return(entry != null
                         ? AggregatorAccessSortedImpl.CheckedPayloadMayDeque(entry.Value.Value).Underlying
                         : null);
 }