Example #1
0
        /// <summary>
        ///     Constructor creates a moving window extending the specified number of elements into the past.
        /// </summary>
        /// <param name="size">is the specified number of elements into the past</param>
        /// <param name="lengthWindowViewFactory">for copying this view in a group-by</param>
        /// <param name="agentInstanceContext">context</param>
        public LengthWindowViewRStream(
            AgentInstanceViewFactoryChainContext agentInstanceContext,
            LengthWindowViewFactory lengthWindowViewFactory,
            int size)
        {
            if (size < 1) {
                throw new ArgumentException("Illegal argument for size of length window");
            }

            _agentInstanceContext = agentInstanceContext.AgentInstanceContext;
            _lengthWindowViewFactory = lengthWindowViewFactory;
            Size = size;
            _indexedEvents = new LinkedHashSet<EventBean>();
        }
Example #2
0
        /// <summary>
        /// Constructor creates a moving window extending the specified number of elements into the past.
        /// </summary>
        /// <param name="agentInstanceContext">The agent instance context.</param>
        /// <param name="viewFactory">for copying this view in a group-by</param>
        /// <param name="size">is the specified number of elements into the past</param>
        /// <param name="viewUpdatedCollection">is a collection that the view must update when receiving events</param>
        /// <exception cref="ArgumentException">Illegal argument for size of length window</exception>
        public LengthWindowView(
            AgentInstanceViewFactoryChainContext agentInstanceContext,
            LengthWindowViewFactory viewFactory,
            int size,
            ViewUpdatedCollection viewUpdatedCollection)
        {
            if (size < 1) {
                throw new ArgumentException("Illegal argument for size of length window");
            }

            this.agentInstanceContext = agentInstanceContext.AgentInstanceContext;
            this.viewFactory = viewFactory;
            Size = size;
            ViewUpdatedCollection = viewUpdatedCollection;
        }