예제 #1
0
        private void TryParameter(Object[] param, int size)
        {
            var factory = new LengthWindowViewFactory();

            factory.SetViewParameters(SupportStatementContextFactory.MakeViewContext(), TestViewSupport.ToExprListBean(param));
            var view = (LengthWindowView)factory.MakeView(SupportStatementContextFactory.MakeAgentInstanceViewFactoryContext());

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

            _agentInstanceViewFactoryContext = agentInstanceViewFactoryContext;
            _lengthWindowViewFactory         = lengthWindowViewFactory;
            _size          = size;
            _indexedEvents = new LinkedHashSet <EventBean>();
        }
예제 #3
0
        /// <summary>
        /// Constructor creates a moving window extending the specified number of elements into the past.
        /// </summary>
        /// <param name="agentInstanceViewFactoryContext">The agent instance view factory context.</param>
        /// <param name="lengthWindowViewFactory">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>
        public LengthWindowView(
            AgentInstanceViewFactoryChainContext agentInstanceViewFactoryContext,
            LengthWindowViewFactory lengthWindowViewFactory,
            int size,
            ViewUpdatedCollection viewUpdatedCollection)
        {
            if (size < 1)
            {
                throw new ArgumentException("Illegal argument for size of length window");
            }

            _agentInstanceViewFactoryContext = agentInstanceViewFactoryContext;
            _lengthWindowViewFactory         = lengthWindowViewFactory;
            _size = size;
            _viewUpdatedCollection = viewUpdatedCollection;
        }
예제 #4
0
 public void SetUp()
 {
     _factory = new LengthWindowViewFactory();
 }
예제 #5
0
 public void SetUp()
 {
     _container = SupportContainer.Reset();
     _factory   = new LengthWindowViewFactory();
 }