SortedTreeNodeBaseTKey, TValue Class

An abstract base class for sorted tree nodes, used in SortedTree structures.

Definition

Namespace: SnapDB.Snap.Tree
Assembly: SnapDB (in SnapDB.dll) Version: 1.0.102.0 -- Release Build+29075351d0e5aa4dea46a5c520805222f672dc2e
public abstract class SortedTreeNodeBase<TKey, TValue> : Node<TKey>
where TKey : new(), SnapTypeBase<TKey>
where TValue : new(), SnapTypeBase<TValue>
Inheritance
Object    NodeTKey    SortedTreeNodeBaseTKey, TValue
Derived

Type Parameters

TKey
The type of keys in the tree.
TValue
The type of values associated with keys in the tree.

Constructors

SortedTreeNodeBaseTKey, TValue Initializes a new instance of the SortedTreeNodeBaseTKey, TValue class with the specified level.

Properties

HeaderSize Gets the byte offset of the header size.
(Inherited from NodeTKey)
IsLeftSiblingIndexNull Is the index of the left sibling null, i.e., equal to MaxValue
(Inherited from NodeTKey)
IsRightSiblingIndexNull Is the index of the right sibling null, i.e., equal to MaxValue
(Inherited from NodeTKey)
LeftSiblingNodeIndex The index of the left sibling. MaxValue is the null case.
(Inherited from NodeTKey)
LowerKey The lower bounds of the node. This is an inclusive bounds and always valid.
(Inherited from NodeTKey)
MaxOverheadWithCombineNodes Gets the maximum overhead allowed when combining nodes during tree operations.
NodeIndex Gets the node index of this current node.
(Inherited from NodeTKey)
NodePosition Gets the first position for the current node.
(Inherited from NodeTKey)
RecordCount Gets or sets the number of records in this node.
(Inherited from NodeTKey)
RemainingBytes Gets or sets the number of unused bytes in the node.
(Inherited from NodeTKey)
RightSiblingNodeIndex The index of the right sibling. MaxValue is the null case.
(Inherited from NodeTKey)
StartOfDataPosition The position that points to the location right after the header which is the start of the data within the node.
(Inherited from NodeTKey)
UpperKey The upper bounds of the node. This is an exclusive bounds and is valid when there is a sibling to the right. If there is no sibling to the right, it should still be valid except for the maximum key value condition.
(Inherited from NodeTKey)
ValidBytes The number of bytes that are used in this node.
(Inherited from NodeTKey)

Methods

AppendSequentialStream Requests the insertion of the current stream into the tree. Sequential insertion can only occur while the stream is in order and entirely past the end of the tree.
CanCombineWithSiblings Determines which sibling node that this node can be combined with.
Clear Invalidates the current node.
(Inherited from NodeTKey)
Clone Creates a clone of the tree node with the specified level.
CreateEmptyNode Creates an empty node with the specified node index.
(Inherited from NodeTKey)
CreateNewNode Creates a new node with the provided data.
(Inherited from NodeTKey)
CreateTreeScanner Returns a tree scanner class for this tree node.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetIndexOf Gets the index of the specified key in the node.
GetOrGetNext Gets the provided key or the key that is directly to the right of this key.
GetReadPointer Retrieves a read pointer to the current node's data.
(Inherited from NodeTKey)
GetReadPointerAfterHeader Gets a read pointer positioned immediately after the node header.
(Inherited from NodeTKey)
GetTypeGets the Type of the current instance.
(Inherited from Object)
GetValidBytes Retrieves the valid bytes count from the specified node's header.
(Inherited from NodeTKey)
GetWritePointer Retrieves a write pointer to the current node's data.
(Inherited from NodeTKey)
GetWritePointerAfterHeader Retrieves a write pointer to the data area after the node's header.
(Inherited from NodeTKey)
IncrementOneRecord Modifies both the RecordCount and ValidBytes in one function call.
(Inherited from NodeTKey)
IncrementRecordCounts Increments the record counts and valid bytes of the node by the specified amounts.
(Inherited from NodeTKey)
Initialize Initializes the required parameters for this tree to function. Must be called once.
InitializeNode Initializes the node with the given binary stream and block size.
(Inherited from NodeTKey)
InitializeType Initializes the specific type of tree node.
InsertUnlessFull Inserts the provided key and value into the current node unless it is full. Note: A duplicate key has already been detected and will never be passed to this function.
IsKeyInsideBounds Checks if the specified key falls within the bounds of this node.
(Inherited from NodeTKey)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Read(Int32, TValue) Reads the value at the specified index and stores it in the provided value.
Read(Int32, TKey, TValue) Reads both the key and value at the specified index and stores them in the provided key and value.
RemoveUnlessOverflow Removes the element at the specified index unless it causes an overflow in the node.
SeekToFirstNode Seeks to the first node at this level of the tree.
SeekToLastNode Seeks to the last node at this level of the tree.
SeekToLeftSibling Seeks the current node to the left sibling node. Throws an exception if the navigation fails.
(Inherited from NodeTKey)
SeekToRightSibling Seeks the current node to the right sibling node. Throws an exception if the navigation fails.
(Inherited from NodeTKey)
SetLeftSiblingProperty Sets the left sibling property of a node with the specified index to a new value.
(Inherited from NodeTKey)
SetNodeIndex Sets the node index to the specified value, updating the node's internal state.
(Inherited from NodeTKey)
Split Splits the node into two nodes, creating a new node with the specified newNodeIndex and dividingKey.
ToStringReturns a string that represents the current object.
(Inherited from Object)
TransferRecordsFromLeftToRight Transfers records from the left node to the right node, moving bytesToTransfer bytes.
TransferRecordsFromRightToLeft Transfers records from the right node to the left node, moving bytesToTransfer bytes.
TryGet Gets the value for the provided key if it exists.
TryGet2 Gets the value for the provided key if it exists.
TryGetFirstRecord(TValue) Gets the first record contained in the current node of the tree.
TryGetFirstRecord(TKey, TValue) Gets the first record contained in the current node of the tree.
TryGetLastRecord(TValue) Gets the last record contained in the current node of the tree.
TryGetLastRecord(TKey, TValue) Gets the last record contained in the current node of the tree.
TryInsert Inserts the following value to the tree if it does not exist.
TryInsert2 Inserts the following value to the tree if it does not exist.
TryInsertSequentialStream Attempts to insert a sequential stream of key-value pairs into the tree.
TryRemove Tries to remove the specified key from the node.
TryRemove2 Tries to remove the specified key from the node or performs additional actions if needed.
UpdateKey Updates the key of a non-leaf node.
UpdateValue Updates the value associated with a key in a non-leaf node.

Events

NodeIndexChanged Occurs when the node index is changed or cleared.
(Inherited from NodeTKey)

Fields

BlockSize Block size of the node.
(Inherited from NodeTKey)
KeyMethods Custom methods for handling keys of type TKey.
(Inherited from NodeTKey)
KeySize Size of a key in bytes.
(Inherited from NodeTKey)
KeyValueSize The size in bytes of a key-value pair.
Level Level of the node within the tree hierarchy.
(Inherited from NodeTKey)
SparseIndex The sparse index used for navigation.
Stream Binary stream pointer used for reading and writing data.
(Inherited from NodeTKey)

See Also