public virtual IBTreeRange CreateIncludingRange(Db4objects.Db4o.Internal.Btree.BTreeNodeSearchResult end) { BTreePointer firstPointer = FirstValidPointer(); BTreePointer endPointer = end._foundMatch ? end._pointer.Next() : end.FirstValidPointer (); return(new BTreeRangeSingle(_transaction, _btree, firstPointer, endPointer)); }
public virtual IBTreeRange CreateIncludingRange(BTreeNodeSearchResult end) { var firstPointer = FirstValidPointer(); var endPointer = end._foundMatch ? end._pointer.Next() : end.FirstValidPointer (); return new BTreeRangeSingle(_transaction, _btree, firstPointer, endPointer); }
public virtual IBTreeRange CreateIncludingRange(BTreeNodeSearchResult end) { var firstPointer = FirstValidPointer(); var endPointer = end._foundMatch ? end._pointer.Next() : end.FirstValidPointer (); return(new BTreeRangeSingle(_transaction, _btree, firstPointer, endPointer)); }
private BTreePointer FirstBTreePointer() { // We don't want nulls included so we have to search for null and use the resulting pointer if we find one. IIndexable4 keyHandler = Btree().KeyHandler(); if (keyHandler is ICanExcludeNullInQueries) { ICanExcludeNullInQueries canExcludeNullInQueries = (ICanExcludeNullInQueries)keyHandler; if (canExcludeNullInQueries.ExcludeNull()) { BTreeNodeSearchResult searchLeaf = Btree().SearchLeafByObject(Transaction(), null , SearchTarget.Highest); BTreePointer pointer = searchLeaf.FirstValidPointer(); if (pointer != null) { return(pointer); } } } return(Btree().FirstPointer(Transaction())); }
public virtual BTreePointer SearchPointer(Transaction trans, object key) { EnsureActive(trans); KeyCantBeNull(key); IPreparedComparison preparedComparison = KeyHandler().PrepareComparison(trans.Context (), key); BTreeNodeSearchResult start = SearchLeaf(trans, preparedComparison, SearchTarget. Lowest); BTreePointer bTreePointer = start.FirstValidPointer(); if (bTreePointer == null) { ConvertCacheEvictedNodesToReadMode(); return(null); } object found = bTreePointer.Key(); ConvertCacheEvictedNodesToReadMode(); if (preparedComparison.CompareTo(found) == 0) { return(bTreePointer); } return(null); }