本文整理汇总了C#中NeoDatis.GetKey方法的典型用法代码示例。如果您正苦于以下问题:C# NeoDatis.GetKey方法的具体用法?C# NeoDatis.GetKey怎么用?C# NeoDatis.GetKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NeoDatis
的用法示例。
在下文中一共展示了NeoDatis.GetKey方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckValuesOfChild
private static void CheckValuesOfChild(NeoDatis.Btree.IKeyAndValue key, NeoDatis.Btree.IBTreeNode
node)
{
if (!on)
{
return;
}
if (node == null)
{
return;
}
for (int i = 0; i < node.GetNbKeys(); i++)
{
if (node.GetKeyAndValueAt(i).GetKey().CompareTo(key.GetKey()) >= 0)
{
throw new NeoDatis.Btree.Exception.BTreeNodeValidationException("Left child with values bigger than pivot "
+ key + " : " + node.ToString());
}
}
}
示例2: DeleteKeyForLeafNode
public override object DeleteKeyForLeafNode(NeoDatis.Btree.IKeyAndValue keyAndValue
)
{
bool objectHasBeenFound = false;
int position = GetPositionOfKey(keyAndValue.GetKey());
if (position < 0)
{
return null;
}
int realPosition = position - 1;
// In Multiple Values per key, the value is a list
System.Collections.IList value = (System.Collections.IList)values[realPosition];
// Here we must search for the right object. The list can contains more than 1 object
int size = value.Count;
for (int i = 0; i < size && !objectHasBeenFound; i++)
{
if (value[i].Equals(keyAndValue.GetValue()))
{
value.Remove(i);
objectHasBeenFound = true;
}
}
if (!objectHasBeenFound)
{
return null;
}
// If after removal, the list is empty, then remove the key from the node
if (value.Count == 0)
{
// If we get there
LeftShiftFrom(realPosition, false);
nbKeys--;
}
NeoDatis.Btree.Tool.BTreeValidator.ValidateNode(this);
return keyAndValue.GetValue();
}
示例3: SetKeyAndValueAt
public virtual void SetKeyAndValueAt(NeoDatis.Btree.IKeyAndValue keyAndValue, int
index, bool shiftIfAlreadyExist, bool incrementNbKeys)
{
SetKeyAndValueAt(keyAndValue.GetKey(), keyAndValue.GetValue(), index, shiftIfAlreadyExist
, incrementNbKeys);
}
示例4: DeleteKeyForLeafNode
public virtual object DeleteKeyForLeafNode(NeoDatis.Btree.IKeyAndValue keyAndValue
)
{
int position = GetPositionOfKey(keyAndValue.GetKey());
if (position < 0)
{
return null;
}
int realPosition = position - 1;
object value = values[realPosition];
LeftShiftFrom(realPosition, false);
nbKeys--;
NeoDatis.Btree.Tool.BTreeValidator.ValidateNode(this);
return value;
}