当前位置: 首页>>代码示例>>C#>>正文


C# NeoDatis.GetKeyAt方法代码示例

本文整理汇总了C#中NeoDatis.GetKeyAt方法的典型用法代码示例。如果您正苦于以下问题:C# NeoDatis.GetKeyAt方法的具体用法?C# NeoDatis.GetKeyAt怎么用?C# NeoDatis.GetKeyAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NeoDatis的用法示例。


在下文中一共展示了NeoDatis.GetKeyAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckIfCanMergeWith

		private void CheckIfCanMergeWith(NeoDatis.Btree.IBTreeNode node)
		{
			if (nbKeys + node.GetNbKeys() > maxNbKeys)
			{
				throw new NeoDatis.Btree.Exception.BTreeException("Trying to merge two nodes with too many keys "
					 + nbKeys + " + " + node.GetNbKeys() + " > " + maxNbKeys);
			}
			if (nbKeys > 0)
			{
				System.IComparable greatestOfThis = keys[nbKeys - 1];
				System.IComparable smallestOfOther = node.GetKeyAt(0);
				if (greatestOfThis.CompareTo(smallestOfOther) >= 0)
				{
					throw new NeoDatis.Btree.Exception.BTreeNodeValidationException("Trying to merge two nodes that have intersections :  "
						 + ToString() + " / " + node);
				}
			}
			if (nbKeys < nbChildren)
			{
				throw new NeoDatis.Btree.Exception.BTreeNodeValidationException("Trying to merge two nodes where the first one has more children than keys"
					);
			}
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:23,代码来源:AbstractBTreeNode.cs

示例2: MergeWith

		/// <summary>
		/// Can only merge node without intersection =&gt; the greater key of this must
		/// be smaller than the smallest key of the node
		/// </summary>
		public virtual void MergeWith(NeoDatis.Btree.IBTreeNode node)
		{
			NeoDatis.Btree.Tool.BTreeValidator.ValidateNode(this);
			NeoDatis.Btree.Tool.BTreeValidator.ValidateNode(node);
			CheckIfCanMergeWith(node);
			int j = nbKeys;
			for (int i = 0; i < node.GetNbKeys(); i++)
			{
				SetKeyAndValueAt(node.GetKeyAt(i), node.GetValueAsObjectAt(i), j, false, false);
				SetChildAt(node, i, j, false);
				j++;
			}
			// in this, we have to take the last child
			if (node.GetNbChildren() > node.GetNbKeys())
			{
				SetChildAt(node, node.GetNbChildren() - 1, j, true);
			}
			nbKeys += node.GetNbKeys();
			nbChildren += node.GetNbChildren();
			NeoDatis.Btree.Tool.BTreeValidator.ValidateNode(this);
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:25,代码来源:AbstractBTreeNode.cs


注:本文中的NeoDatis.GetKeyAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。