Difference between revisions of "TLinkedBtree"

From Ultibo.org
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
 
 
 
Return to [[Unit_UltiboClasses|Unit UltiboClasses]]
 
Return to [[Unit_UltiboClasses|Unit UltiboClasses]]
  
Line 45: Line 42:
 
|-
 
|-
 
| <code>function PropogateDrop(AEntry:TBtreeObject):Boolean;</code>
 
| <code>function PropogateDrop(AEntry:TBtreeObject):Boolean;</code>
| &nbsp;
 
|-
 
| <code>function PropogateDropOld(AEntry:TBtreeObject):Boolean;</code>
 
| &nbsp;
 
|-
 
| <code>function PropogateDropOldOld(AEntry:TBtreeObject):Boolean;</code>
 
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
Line 171: Line 162:
 
|-
 
|-
 
| <code>function Drop(AEntry,ADrop,ATarget:TBtreeObject; ALeft:Boolean):Boolean;</code>
 
| <code>function Drop(AEntry,ADrop,ATarget:TBtreeObject; ALeft:Boolean):Boolean;</code>
| &nbsp;
 
|-
 
| <code>function DropOld(AEntry,ADrop:TBtreeObject; ALeft:Boolean):Boolean;</code>
 
| &nbsp;
 
|-
 
| <code>function DropOldOld(AEntry,ADrop:TBtreeObject; ALeft:Boolean):Boolean;</code>
 
| &nbsp;
 
|-
 
| <code>function DropOldOldOld(AEntry,ADrop:TBtreeObject; ALeft:Boolean):Boolean;</code>
 
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
Line 221: Line 203:
 
|-
 
|-
 
| <code>function DropNode(AEntry,ADrop,ATarget:TBtreeObject; ALeft:Boolean):Boolean; virtual;</code>
 
| <code>function DropNode(AEntry,ADrop,ATarget:TBtreeObject; ALeft:Boolean):Boolean; virtual;</code>
| Allows descendants to monitor node drop
 
|-
 
| <code>function DropNodeOld(AEntry,ADrop:TBtreeObject; ALeft:Boolean):Boolean; virtual;</code>
 
 
| Allows descendants to monitor node drop
 
| Allows descendants to monitor node drop
 
|-
 
|-
Line 321: Line 300:
 
|-
 
|-
 
| <code>function Remove(AEntry:TBtreeObject):Boolean;</code>
 
| <code>function Remove(AEntry:TBtreeObject):Boolean;</code>
| &nbsp;
 
|-
 
| <code>function RemoveOld(AEntry:TBtreeObject):Boolean;</code>
 
| &nbsp;
 
|-
 
| <code>function RemoveOldOld(AEntry:TBtreeObject):Boolean;</code>
 
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-

Latest revision as of 05:25, 21 June 2023

Return to Unit UltiboClasses


Description


To be documented

Class definitions



[Expand]

TLinkedBtree = class(TObject)


Function declarations



[Expand]
constructor TLinkedBtree.Create;
Description: To be documented


[Expand]
destructor TLinkedBtree.Destroy;
Description: To be documented


[Expand]
procedure TLinkedBtree.SetOrder(AOrder:LongWord);
Description: Set a new Order and calculate a new Median value


[Expand]
function TLinkedBtree.PropogateDrop(AEntry:TBtreeObject):Boolean;
Description: To be documented


[Expand]
function TLinkedBtree.PropogateMerge(AEntry:TBtreeObject):Boolean;
Description: To be documented


[Expand]
function TLinkedBtree.PropogateSplit(AEntry:TBtreeObject):Boolean;
Description: To be documented


[Expand]
function TLinkedBtree.GetCount(AEntry:TBtreeObject):LongWord;
Description: Get the count of entries in the node of the supplied entry


[Expand]
function TLinkedBtree.GetDepth(AEntry:TBtreeObject):LongWord;
Description: Get the depth of the supplied entry in the btree


[Expand]
function TLinkedBtree.GetEnd(AEntry:TBtreeObject):TBtreeObject;
Description: Get the end entry in the node of the supplied entry


[Expand]
function TLinkedBtree.GetStart(AEntry:TBtreeObject):TBtreeObject;
Description: Get the start entry in the node of the supplied entry


[Expand]
function TLinkedBtree.GetBlank(AEntry:TBtreeObject):TBtreeObject;
Description: Get the blank entry in the node of the supplied entry


[Expand]
function TLinkedBtree.GetMedian(AEntry:TBtreeObject):TBtreeObject;
Description: Get the median entry in the node of the supplied entry


[Expand]
function TLinkedBtree.GetDrop(AEntry:TBtreeObject; var ALeft:Boolean):TBtreeObject;
Description: Get the neighbour with appropriate number of keys to drop


[Expand]
function TLinkedBtree.GetMerge(AEntry:TBtreeObject):TBtreeObject;
Description: Get the neighbour with appropriate number of keys to merge


[Expand]
function TLinkedBtree.GetBorrow(AEntry:TBtreeObject):TBtreeObject;
Description: Get the neighbour with sufficient keys to borrow one


[Expand]
function TLinkedBtree.GetTarget(ADrop:TBtreeObject; ALeft:Boolean):TBtreeObject;
Description: Get the actual target within the neighbour that is appropriate to drop


[Expand]
function TLinkedBtree.SetParent(AEntry,AParent:TBtreeObject):Boolean;
Description: Set the parent for all entries in a node and set the child of the parent


[Expand]
function TLinkedBtree.GetLefthand(AEntry:TBtreeObject):TBtreeObject;
Description: Get the lefthand neighbour (Node) of the supplied entries node


[Expand]
function TLinkedBtree.GetRighthand(AEntry:TBtreeObject):TBtreeObject;
Description: Get the righthand neighbour (Node) of the supplied entries node


[Expand]
function TLinkedBtree.GetLeftmost(AEntry:TBtreeObject):TBtreeObject;
Description: Get the leftmost entry in the tree of the supplied entry


[Expand]
function TLinkedBtree.GetRightmost(AEntry:TBtreeObject):TBtreeObject;
Description: Get the rightmost entry in the tree of the supplied entry


[Expand]
function TLinkedBtree.GetSuccessor(AEntry:TBtreeObject):TBtreeObject;
Description: Get the successor (Right) entry of the supplied entry


[Expand]
function TLinkedBtree.GetPredecessor(AEntry:TBtreeObject):TBtreeObject;
Description: Get the predecessor (Left) entry of the supplied entry


[Expand]
function TLinkedBtree.GetPosition(AStart,AEntry:TBtreeObject):TBtreeObject;
Description: Get the position where entry should be inserted into the btree


[Expand]
function TLinkedBtree.Push(AEntry:TBtreeObject):Boolean;
Description: Push the node containing the supplied entry


[Expand]
function TLinkedBtree.Split(AEntry:TBtreeObject):Boolean;
Description: Split the node containing the supplied entry


[Expand]
function TLinkedBtree.Swap(AEntry,ASwap:TBtreeObject; ALeft:Boolean):Boolean;
Description: Swap the supplied entries directly from node to node


[Expand]
function TLinkedBtree.Drop(AEntry,ADrop,ATarget:TBtreeObject; ALeft:Boolean):Boolean;
Description: Drop the nodes of the supplied entries into one


[Expand]
function TLinkedBtree.Merge(AEntry,AMerge:TBtreeObject):Boolean;
Description: Merge the nodes of the supplied entries into one


[Expand]
function TLinkedBtree.Borrow(AEntry,ABorrow:TBtreeObject):Boolean;
Description: Borrow an entry from the supplied node to balance the tree


[Expand]
function TLinkedBtree.Link(AEntry,ANext:TBtreeObject):Boolean;
Description: Link the object to Prev/Next in linked list


[Expand]
function TLinkedBtree.Unlink(AEntry:TBtreeObject):Boolean;
Description: Unlink the object from Prev/Next in linked list


[Expand]
function TLinkedBtree.LinkBlank(AEntry:TBtreeObject):Boolean;
Description: Link the object to Prev/Next in blank key list


[Expand]
function TLinkedBtree.UnlinkBlank(AEntry:TBtreeObject):Boolean;
Description: Unlink the object from Prev/Next in blank key list


[Expand]
function TLinkedBtree.Attach(AParent,AEntry,ARight:TBtreeObject):Boolean;
Description: Attach the object to Parent/Left/Right in btree


[Expand]
function TLinkedBtree.Detach(AEntry:TBtreeObject):Boolean;
Description: Detach the object from Parent/Left/Right in btree


[Expand]
function TLinkedBtree.PushNode(AEntry:TBtreeObject):Boolean;
Description: Called before a node is pushed following insert of an entry


[Expand]
function TLinkedBtree.SplitNode(AEntry:TBtreeObject):Boolean;
Description: Called before a node is split following insert of an entry


[Expand]
function TLinkedBtree.DropNode(AEntry,ADrop,ATarget:TBtreeObject; ALeft:Boolean):Boolean;
Description: Called before a node is dropped following removal of an entry


[Expand]
function TLinkedBtree.MergeNode(AEntry,AMerge:TBtreeObject):Boolean;
Description: Called before a node is merged following removal of an entry


[Expand]
function TLinkedBtree.BorrowEntry(AEntry,ABorrow:TBtreeObject):Boolean;
Description: Called before an entry is borrowed following removal of an entry


[Expand]
function TLinkedBtree.SwapEntry(AEntry,ASwap:TBtreeObject; ALeft:Boolean):Boolean;
Description: Called before an entry is swapped during a merge or borrow


[Expand]
function TLinkedBtree.SetParentEntry(AEntry,AParent:TBtreeObject):Boolean;
Description: Called after an entry is reparented during a push, split, merge, borrow or swap


[Expand]
function TLinkedBtree.CreateBlank:TBtreeObject;
Description: Create a blank key when a node is added (Split/Empty)


[Expand]
function TLinkedBtree.DeleteBlank(ABlank:TBtreeObject):Boolean;
Description: Delete a blank key when a node is removed (Merge)


[Expand]
function TLinkedBtree.AttachBlank(ABlank:TBtreeObject):Boolean;
Description: Called after a blank entry is attached to a node during split or merge


[Expand]
function TLinkedBtree.DetachBlank(ABlank:TBtreeObject):Boolean;
Description: Called before a blank entry is detached from a node during split or merge


[Expand]
function TLinkedBtree.AttachEntry(AEntry:TBtreeObject):Boolean;
Description: Called after a non blank entry is attached to a node during insert or remove


[Expand]
function TLinkedBtree.DetachEntry(AEntry:TBtreeObject):Boolean;
Description: Called before a non blank entry is detached from a node during insert or remove


[Expand]
function TLinkedBtree.RequirePush(AEntry:TBtreeObject):Boolean;
Description: Called after an entry is inserted to determine if a push is required


[Expand]
function TLinkedBtree.RequireSplit(AEntry:TBtreeObject):Boolean;
Description: Called after an entry is inserted to determine if a split is required


[Expand]
function TLinkedBtree.RequireDrop(AEntry:TBtreeObject):Boolean;
Description: Called after an entry is removed to determine if a drop is required


[Expand]
function TLinkedBtree.RequireMerge(AEntry:TBtreeObject):Boolean;
Description: Called after an entry is removed to determine if a merge is required


[Expand]
function TLinkedBtree.RequireBorrow(AEntry:TBtreeObject):Boolean;
Description: Called after an entry is removed to determine if a borrow is required


[Expand]
function TLinkedBtree.Compare(AEntry1,AEntry2:TBtreeObject):Integer;
Description: Always returns greater than unless the second entry is a blank key


[Expand]
function TLinkedBtree.Add(AParent,AEntry:TBtreeObject):Boolean;
Description: Add an entry to the btree without doing the full insert


[Expand]
function TLinkedBtree.Insert(AEntry:TBtreeObject):Boolean;
Description: Insert an entry in the btree by finding its position


[Expand]
function TLinkedBtree.Remove(AEntry:TBtreeObject):Boolean;
Description: Remove an entry from the btree by deleting it


[Expand]
procedure TLinkedBtree.Clear;
Description: Removes all entries from the btree


[Expand]
procedure TLinkedBtree.Empty;
Description: Removes all entries from the btree and adds a blank root key


[Expand]
procedure TLinkedBtree.Rebuild;
Description: Empties the btree and rebuilds from the linked list


Return to Unit Reference