コード例 #1
0
 public ExpressionResultCacheEntryEventBeanArrayAndCollBean(
     EventBean[] reference,
     FlexCollection result)
 {
     Reference = reference;
     Result = result;
 }
コード例 #2
0
 public static object ToArray(FlexCollection input)
 {
     if (input.IsEventBeanCollection) {
         return input.EventBeanCollection.ToArray();
     }
     else {
         return input.ObjectCollection.ToArray();
     }
 }
コード例 #3
0
 public void SavePropertyColl(
     string propertyNameFullyQualified,
     EventBean reference,
     FlexCollection events)
 {
     var entry = new ExpressionResultCacheEntryBeanAndCollBean(reference, events);
     collPropertyCache.Put(
         propertyNameFullyQualified,
         new SoftReference<ExpressionResultCacheEntryBeanAndCollBean>(entry));
 }
コード例 #4
0
 public static bool EventsCheckStrings(
     FlexCollection events,
     string property,
     string value)
 {
     return EventsCheckStrings(
         events.EventBeanCollection,
         property,
         value);
 }
コード例 #5
0
 public void SaveDeclaredExpressionLastColl(
     object node,
     EventBean[] eventsPerStream,
     FlexCollection result)
 {
     var copy = EventBeanUtility.CopyArray(eventsPerStream);
     var entry = new ExpressionResultCacheEntryEventBeanArrayAndCollBean(copy, result: result);
     exprDeclCacheCollection.Put(
         node,
         new SoftReference<ExpressionResultCacheEntryEventBeanArrayAndCollBean>(entry));
 }
コード例 #6
0
 public static FlexCollection UnwrapEventBeans(
     EventBeanTypedEventFactory eventBeanTypedEventFactory,
     BeanEventType type,
     IEnumerable enumerable)
 {
     return FlexCollection.Of(
         enumerable
             .Cast<object>()
             .Select(value => eventBeanTypedEventFactory.AdapterForTypedObject(value, type))
             .ToList());
 }
コード例 #7
0
        public static FlexCollection EvaluateEnumMethodTakeLast(
            FlexCollection enumcoll,
            int size)
        {
            if (enumcoll.IsEventBeanCollection) {
                return FlexCollection.Of(
                    EvaluateEnumMethodTakeLast(enumcoll.EventBeanCollection, size));
            }

            return FlexCollection.Of(
                EvaluateEnumMethodTakeLast(enumcoll.ObjectCollection, size));
        }
コード例 #8
0
ファイル: EventBeanUtility.cs プロジェクト: lanicon/nesper
 public static EventBean EvaluateFilterExpectSingleMatch(
     EventBean[] eventsZeroSubselect,
     bool newData,
     FlexCollection matchingEvents,
     ExprEvaluatorContext exprEvaluatorContext,
     ExprEvaluator filter)
 {
     return EvaluateFilterExpectSingleMatch(
         eventsZeroSubselect,
         newData,
         matchingEvents.EventBeanCollection,
         exprEvaluatorContext,
         filter);
 }
コード例 #9
0
        public static FlexCollection EnumExceptForgeEvalSet(
            FlexCollection other,
            FlexCollection enumcoll)
        {
            if (other.IsEventBeanCollection) {
                if (enumcoll.IsEventBeanCollection) {
                    return FlexCollection.Of(EnumExceptForgeEvalSet(
                        other.EventBeanCollection,
                        enumcoll.EventBeanCollection));
                }
            } else if (enumcoll.IsObjectCollection) {
                return FlexCollection.Of(EnumExceptForgeEvalSet(
                    other.ObjectCollection,
                    enumcoll.ObjectCollection));
            }

            throw new ArgumentException("mismatch in FlexCollection types");
        }
コード例 #10
0
        public static FlexCollection ConvertToCollection(
            string propertyName, 
            object value)
        {
            if (value == null) {
                return null;
            }

            if (value is string stringValue) {
                // Convert to a collection of characters
                return FlexCollection.Of(
                    stringValue
                        .ToCharArray()
                        .Cast<object>()
                        .ToList());
            }

            Log.Warn(
                "Expected string-type input from property '" + propertyName + "' but received " + value.GetType());
            return null;
        }
コード例 #11
0
        /// <summary>
        ///     NOTE: Code-generation-invoked method, method name and parameter order matters
        /// </summary>
        /// <param name="enumcoll">collection</param>
        /// <param name="size">size</param>
        /// <returns>collection</returns>
        public static FlexCollection EvaluateEnumTakeMethod(
            FlexCollection enumcoll,
            int size)
        {
            if (enumcoll.Count == 0) {
                return FlexCollection.Empty;
            }

            if (size <= 0) {
                return FlexCollection.Empty;
            }

            if (enumcoll.Count < size) {
                return enumcoll;
            }

            if (size == 1) {
                if (enumcoll.IsEventBeanCollection) {
                    return FlexCollection.OfEvent(
                        enumcoll.EventBeanCollection.First());
                }
                else {
                    return FlexCollection.OfObject(
                        enumcoll.ObjectCollection.First());
                }
            }

            if (enumcoll.IsEventBeanCollection) {
                return FlexCollection.Of(
                    enumcoll.EventBeanCollection
                    .Take(size)
                    .ToList());
            }

            return FlexCollection.Of(
                enumcoll.ObjectCollection
                    .Take(size)
                    .ToList());
        }
コード例 #12
0
ファイル: EventBeanUtility.cs プロジェクト: lanicon/nesper
 /// <summary>
 ///     NOTE: Code-generation-invoked method, method name and parameter order matters
 /// </summary>
 /// <param name="matchingEvents">events</param>
 /// <returns>event</returns>
 public static EventBean GetNonemptyFirstEvent(FlexCollection matchingEvents)
 {
     return GetNonemptyFirstEvent(matchingEvents.EventBeanCollection);
 }
コード例 #13
0
ファイル: EventBeanUtility.cs プロジェクト: lanicon/nesper
 public static object GetNonemptyFirstEventUnderlying(FlexCollection matchingEvents)
 {
     return GetNonemptyFirstEventUnderlying(matchingEvents.EventBeanCollection);
 }
コード例 #14
0
 /// <summary>
 /// NOTE: Code-generation-invoked method, method name and parameter order matters
 /// </summary>
 /// <param name="enumcoll">events</param>
 /// <returns>array</returns>
 public static EventBean[] TakeWhileLastEventBeanToArray(FlexCollection enumcoll)
 {
     return(enumcoll.IsEventBeanCollection
                         ? enumcoll.EventBeanCollection.ToArray()
                         : enumcoll.ObjectCollection.UnwrapIntoArray <EventBean>());
 }
コード例 #15
0
 public static FlexCollection AsFlexCollection(this object value)
 {
     return(FlexCollection.Of(value));
 }
コード例 #16
0
 public EventUnderlyingCollection(FlexCollection flexCollection)
 {
     _underlyingCollection = flexCollection.EventBeanCollection;
 }