Example #1
0
        ///
        ///	 <summary> * modifies queue to match this filter by removing all non-matching entries
        ///	 *
        ///	 * make sure that this is a copy of any original queue as the incoming queue itself is not cloned
        ///	 *  </summary>
        ///	 * <param name="theQueue"> the queue to modify </param>
        ///
        public virtual void match(JDFQueue theQueue)
        {
            int maxEntries = hasAttribute(AttributeName.MAXENTRIES) ? getMaxEntries() : 999999;

            VElement v = theQueue.getQueueEntryVector();

            if (v != null)
            {
                int size = v.Count;
                theQueue.setQueueSize(size);

                for (int i = 0; i < size; i++)
                {
                    JDFQueueEntry qe = (JDFQueueEntry)v[i];
                    match(qe);
                }
            }

            for (int i = theQueue.numEntries(null) - 1; i >= maxEntries; i--)
            {
                theQueue.removeChild(ElementName.QUEUEENTRY, null, maxEntries);
            }
            // always zapp first - it is faster to find
        }
Example #2
0
        public virtual void testGetQueueEntryVectorByIdentifier()
        {
            NodeIdentifier ni = new NodeIdentifier("j2", null, null);

            Assert.AreEqual(q.getQueueEntry(1), q.getQueueEntryVector(ni)[0]);
            Assert.AreEqual(q.getQueueEntry(0), q.getQueueEntryVector(null)[0]);
            Assert.AreEqual(q.numChildElements(ElementName.QUEUEENTRY, null), q.getQueueEntryVector(null).Count);
        }