private void Match(int valIndex, string segment, QueryBranchResultSet results)
 {
     TrieTraverser traverser = new TrieTraverser(this.trie.Root, segment);
     while (traverser.MoveNext())
     {
         object data = traverser.Segment.Data;
         if (data != null)
         {
             results.Add((QueryBranch) data, valIndex);
         }
     }
 }
 internal override void Match(int valIndex, ref Value val, QueryBranchResultSet results)
 {
     if (ValueDataType.Sequence == val.Type)
     {
         NodeSequence sequence = val.Sequence;
         for (int i = 0; i < sequence.Count; i++)
         {
             this.Match(valIndex, sequence.Items[i].NumberValue(), results);
         }
     }
     else
     {
         this.Match(valIndex, val.ToDouble(), results);
     }
 }
 private void Match(int valIndex, double point, QueryBranchResultSet results)
 {
     IntervalTreeTraverser traverser = new IntervalTreeTraverser(point, this.intervalTree.Root);
     while (traverser.MoveNext())
     {
         IntervalCollection slot = traverser.Slot;
         int num = 0;
         int count = slot.Count;
         while (num < count)
         {
             QueryBranch branch = slot[num].Branch;
             if (branch != null)
             {
                 results.Add(branch, valIndex);
             }
             num++;
         }
     }
 }
 internal override void Match(int valIndex, ref Value val, QueryBranchResultSet results)
 {
     QueryBranch branch = null;
     if (ValueDataType.Sequence == val.Type)
     {
         NodeSequence sequence = val.Sequence;
         for (int i = 0; i < sequence.Count; i++)
         {
             branch = this[sequence.Items[i].StringValue()];
             if (branch != null)
             {
                 results.Add(branch, valIndex);
             }
         }
     }
     else
     {
         branch = this[val.String];
         if (branch != null)
         {
             results.Add(branch, valIndex);
         }
     }
 }
 internal void ReleaseResults(QueryBranchResultSet resultSet)
 {
     this.PushResultSet(resultSet);
 }
 internal void PushResultSet(QueryBranchResultSet resultSet)
 {
     resultSet.Next = this.resultPool;
     this.resultPool = resultSet;
 }
 internal QueryBranchResultSet PopResultSet()
 {
     QueryBranchResultSet resultPool = this.resultPool;
     if (resultPool != null)
     {
         this.resultPool = resultPool.Next;
         resultPool.Next = null;
     }
     return resultPool;
 }
예제 #8
0
 internal void ReleaseResults(QueryBranchResultSet resultSet)
 {
     Fx.Assert(null != resultSet, "");
     this.PushResultSet(resultSet);
 }
예제 #9
0
        internal void PushResultSet(QueryBranchResultSet resultSet)
        {
            Fx.Assert(null != resultSet, "");

            resultSet.Next = this.resultPool;
            this.resultPool = resultSet;
        }
예제 #10
0
 internal QueryBranchResultSet PopResultSet()
 {
     QueryBranchResultSet resultSet = this.resultPool;
     if (null != resultSet)
     {
         this.resultPool = resultSet.Next;
         resultSet.Next = null;
     }
     return resultSet;
 }
예제 #11
0
 public override void Reset()
 {
     base.Release();            
     // Trim local pools by releasing all references
     while (null != this.PopResultSet());            
     this.resultPool = null;
     while (null != this.PopSequence());
     this.sequencePool = null;
     while (null != this.PopContext());
     this.contextPool = null;
 }
 internal BranchMatcher(int resultCount, QueryBranchResultSet resultTable)
 {
     this.resultCount = resultCount;
     this.resultTable = resultTable;
 }
예제 #13
0
 void Match(int valIndex, double point, QueryBranchResultSet results)
 {
     IntervalTreeTraverser traverser = new IntervalTreeTraverser(point, this.intervalTree.Root);
     while (traverser.MoveNext())
     {
         IntervalCollection matches = traverser.Slot;
         for (int i = 0, count = matches.Count; i < count; ++i)
         {
             QueryBranch branch = matches[i].Branch;
             if (null != branch)
             {
                 results.Add(branch, valIndex);
             }
         }
     }
 }
 internal abstract void Match(int valIndex, ref Value val, QueryBranchResultSet results);
예제 #15
0
 internal override void Match(int valIndex, ref Value val, QueryBranchResultSet results)
 {
     QueryBranch branch = null;
     if (ValueDataType.Sequence == val.Type)
     {
         NodeSequence sequence = val.Sequence;
         for (int i = 0; i < sequence.Count; ++i)
         {
             branch = this[sequence.Items[i].NumberValue()];
             if (null != branch)
             {
                 results.Add(branch, valIndex);
             }
         }
     }
     else
     {
         branch = this[val.ToDouble()];
         if (null != branch)
         {
             results.Add(branch, valIndex);
         }
     }
 }
 internal virtual void CollectMatches(int valIndex, ref Value val, QueryBranchResultSet results)
 {
     this.branchIndex.Match(valIndex, ref val, results);
 }