/// /// <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 }
public virtual void testgetQueueSize() { Assert.AreEqual(5, q.getQueueSize(), "no size set - count entries"); q.setQueueSize(10); Assert.AreEqual(10, q.getQueueSize()); }