private TreeInt ToTreeInt(IIndexedNode result) { ByRef treeInts = ByRef.NewInstance(); result.Traverse(new _IIntVisitor_65(treeInts)); return((TreeInt)treeInts.value); }
public virtual IIndexedNode SelectBestIndex() { IEnumerator i = CollectIndexedNodes(); IIndexedNode best = null; while (i.MoveNext()) { IIndexedNode indexedNode = (IIndexedNode)i.Current; IIndexedNode resolved = ResolveFully(indexedNode); if (resolved == null) { continue; } if (best == null) { best = indexedNode; continue; } if (indexedNode.ResultSize() < best.ResultSize()) { best = indexedNode; } } return(best); }
public static void Traverse(IIndexedNode node, IIntVisitor visitor) { IEnumerator i = node.GetEnumerator(); while (i.MoveNext()) { IFieldIndexKey composite = (IFieldIndexKey)i.Current; visitor.Visit(composite.ParentID()); } }
public static IIndexedNode NewParentPath(IIndexedNode next, QCon constraint) { if (!CanFollowParent(constraint)) { return null; } return new IndexedPath((QConObject) constraint .Parent(), next); }
public static IIndexedNode NewParentPath(IIndexedNode next, QCon constraint) { if (!CanFollowParent(constraint)) { return(null); } return(new IndexedPath((QConObject)constraint .Parent(), next)); }
public static IIndexedNode NewParentPath(IIndexedNode next, QCon constraint) { if (!CanFollowParent(constraint)) { return(null); } return(new Db4objects.Db4o.Internal.Fieldindex.IndexedPath((QConObject)constraint .Parent(), next)); }
public static IIndexedNode NewParentPath(IIndexedNode next, QCon constraint) { if (!CanFollowParent(constraint)) { return null; } return new Db4objects.Db4o.Internal.Fieldindex.IndexedPath((QConObject)constraint .Parent(), next); }
public static TreeInt AddToTree(TreeInt tree, IIndexedNode node) { IEnumerator i = node.GetEnumerator(); while (i.MoveNext()) { IFieldIndexKey composite = (IFieldIndexKey)i.Current; tree = (TreeInt)((TreeInt)Tree.Add(tree, new TreeInt(composite.ParentID()))); } return tree; }
public static TreeInt AddToTree(TreeInt tree, IIndexedNode node) { var i = node.GetEnumerator(); while (i.MoveNext()) { var composite = (IFieldIndexKey)i.Current; tree = (TreeInt)Tree.Add(tree, new TreeInt(composite.ParentID())); } return(tree); }
private IIndexedNode ResolveFully(IIndexedNode indexedNode) { if (null == indexedNode) { return(null); } if (indexedNode.IsResolved()) { return(indexedNode); } return(ResolveFully(indexedNode.Resolve())); }
private IIndexedNode ResolveFully(IIndexedNode bestIndex) { if (null == bestIndex) { return(null); } if (bestIndex.IsResolved()) { return(bestIndex); } return(ResolveFully(bestIndex.Resolve())); }
private IIndexedNode ResolveFully(IIndexedNode indexedNode) { if (null == indexedNode) { return null; } if (indexedNode.IsResolved()) { return indexedNode; } return ResolveFully(indexedNode.Resolve()); }
private IIndexedNode ResolveFully(IIndexedNode bestIndex) { if (null == bestIndex) { return null; } if (bestIndex.IsResolved()) { return bestIndex; } return ResolveFully(bestIndex.Resolve()); }
public virtual FieldIndexProcessorResult Run() { IIndexedNode bestIndex = SelectBestIndex(); if (null == bestIndex) { return(FieldIndexProcessorResult.NoIndexFound); } IIndexedNode resolved = ResolveFully(bestIndex); if (!bestIndex.IsEmpty()) { bestIndex.MarkAsBestIndex(_candidates); return(new FieldIndexProcessorResult(resolved)); } return(FieldIndexProcessorResult.FoundIndexButNoMatch); }
public virtual void TestDoubleDescendingOnIndexedNodes() { IQuery query = CreateComplexItemQuery(); query.Descend("child").Descend("foo").Constrain(3); query.Descend("bar").Constrain(2); IIndexedNode index = SelectBestIndex(query); AssertComplexItemIndex("foo", index); Assert.IsFalse(index.IsResolved()); IIndexedNode result = index.Resolve(); Assert.IsNotNull(result); AssertComplexItemIndex("child", result); Assert.IsTrue(result.IsResolved()); Assert.IsNull(result.Resolve()); AssertComplexItems(new int[] { 4 }, result.ToTreeInt()); }
public virtual IIndexedNode SelectBestIndex() { IEnumerator i = CollectIndexedNodes(); if (!i.MoveNext()) { return(null); } IIndexedNode best = (IIndexedNode)i.Current; while (i.MoveNext()) { IIndexedNode leaf = (IIndexedNode)i.Current; if (leaf.ResultSize() < best.ResultSize()) { best = leaf; } } return(best); }
public virtual FieldIndexProcessorResult Run() { IIndexedNode bestIndex = SelectBestIndex(); if (null == bestIndex) { return(FieldIndexProcessorResult.NoIndexFound); } if (bestIndex.ResultSize() > 0) { IIndexedNode resolved = ResolveFully(bestIndex); if (null == resolved) { return(FieldIndexProcessorResult.NoIndexFound); } resolved.MarkAsBestIndex(); return(new FieldIndexProcessorResult(resolved)); } return(FieldIndexProcessorResult.FoundIndexButNoMatch); }
public IndexedPath(QConObject parent, IIndexedNode next) : base(parent) { _next = next; }
private void AssertBestIndex(string expectedFieldIndex, IQuery query) { IIndexedNode node = SelectBestIndex(query); AssertComplexItemIndex(expectedFieldIndex, node); }
public FieldIndexProcessorResult(IIndexedNode indexedNode) { _indexedNode = indexedNode; }
protected virtual void AssertComplexItemIndex(string expectedFieldIndex, IIndexedNode node) { Assert.AreSame(ComplexItemIndex(expectedFieldIndex), node.GetIndex()); }
private TreeInt ToTreeInt(IIndexedNode result) { ByRef treeInts = ByRef.NewInstance(); result.Traverse(new _IIntVisitor_65(treeInts)); return ((TreeInt)treeInts.value); }