Example #1
0
        public override void VisitRange(BTreeVisitor <TKey> visitor)
        {
            int nextResult = visitor(_records[0].Key, null);

            int idx = 0;

            while (idx < _records.Length)
            {
                int thisResult = nextResult;

                if (idx + 1 < _records.Length)
                {
                    nextResult = visitor(_records[idx + 1].Key, null);
                }
                else
                {
                    nextResult = 1;
                }

                if (thisResult > 0)
                {
                    // This record's key is too big, so no chance further records
                    // will match.
                    return;
                }
                else if (nextResult >= 0)
                {
                    // Next record's key isn't too small, so worth looking at children
                    BTreeKeyedNode <TKey> child = ((BTree <TKey>)Tree).GetKeyedNode(_records[idx].ChildId);
                    child.VisitRange(visitor);
                }

                idx++;
            }
        }
Example #2
0
        public override void VisitRange(BTreeVisitor <TKey> visitor)
        {
            int idx = 0;

            while (idx < _records.Length && visitor(_records[idx].Key, _records[idx].Data) <= 0)
            {
                idx++;
            }
        }
Example #3
0
 public abstract void VisitRange(BTreeVisitor <TKey> visitor);
Example #4
0
 public void VisitRange(BTreeVisitor <TKey> visitor)
 {
     _rootNode.VisitRange(visitor);
 }
Example #5
0
 public virtual void VisitRange(BTreeVisitor <TKey> visitor)
 {
     this.rootNode.VisitRange(visitor);
 }