Esempio n. 1
0
        public void TestArrayLast()
        {
            var deque = new ArrayDeque <int>();

            Assert.That(deque.Count, Is.EqualTo(0));

            deque.Add(1);
            Assert.That(deque.Count, Is.EqualTo(1));
            Assert.That(deque.Last, Is.EqualTo(1));

            deque.Add(2);
            Assert.That(deque.Count, Is.EqualTo(2));
            Assert.That(deque.Last, Is.EqualTo(2));

            deque.Add(3);
            Assert.That(deque.Count, Is.EqualTo(3));
            Assert.That(deque.Last, Is.EqualTo(3));

            deque.Add(4);
            Assert.That(deque.Count, Is.EqualTo(4));
            Assert.That(deque.Last, Is.EqualTo(4));

            Assert.That(deque.RemoveFirst(), Is.EqualTo(1));
            Assert.That(deque.Count, Is.EqualTo(3));
            Assert.That(deque.Last, Is.EqualTo(4));

            Assert.That(deque.RemoveLast(), Is.EqualTo(4));
            Assert.That(deque.Count, Is.EqualTo(2));
            Assert.That(deque.Last, Is.EqualTo(3));
        }
Esempio n. 2
0
 public override void GetTraverseStatement(
     EventTypeIndexTraverse traverse,
     ICollection<int> statementIds,
     ArrayDeque<FilterItem> evaluatorStack)
 {
     foreach (KeyValuePair<ExprNodeAdapterBase, EventEvaluator> entry in evaluatorsMap) {
         evaluatorStack.Add(new FilterItem(PROPERTY_NAME_BOOLEAN_EXPRESSION, FilterOperator, entry));
         entry.Value.GetTraverseStatement(traverse, statementIds, evaluatorStack);
         evaluatorStack.RemoveLast();
     }
 }
Esempio n. 3
0
 public override void GetTraverseStatement(
     EventTypeIndexTraverse traverse,
     ICollection<int> statementIds,
     ArrayDeque<FilterItem> evaluatorStack)
 {
     foreach (var entry in evaluatorsMap) {
         evaluatorStack.Add(new FilterItem(Lookupable.Expression, FilterOperator, entry.Value, this));
         entry.Value.GetTraverseStatement(traverse, statementIds, evaluatorStack);
         evaluatorStack.RemoveLast();
     }
 }
 public override void GetTraverseStatement(
     EventTypeIndexTraverse traverse,
     ICollection <int> statementIds,
     ArrayDeque <FilterItem> evaluatorStack)
 {
     if (eventEvaluator != null)
     {
         evaluatorStack.Add(new FilterItem(Lookupable.Expression, FilterOperator, null, this));
         eventEvaluator.GetTraverseStatement(traverse, statementIds, evaluatorStack);
         evaluatorStack.RemoveLast();
     }
 }
Esempio n. 5
0
 private static void RecursiveFindPatternAtoms(RowRegexExprNode parent, ArrayDeque <RowRegexExprNode> path, IDictionary <String, ISet <String> > map)
 {
     path.Add(parent);
     foreach (var child in parent.ChildNodes)
     {
         if (child is RowRegexExprNodeAtom)
         {
             HandleAtom((RowRegexExprNodeAtom)child, path, map);
         }
         else
         {
             RecursiveFindPatternAtoms(child, path, map);
         }
     }
     path.RemoveLast();
 }