Skip to main content

BalancedBinarySearchTreeNode

Short summary

Class for a balanced, binary, search tree node

AccessAbstractFinalExtendsImplements
-NoNoAbstractDisposableContainerCNM_CollectionInterfaces.IBalancedBinarySearchTreeNode

UML Diagram

Parameters

none

Properties

balance

Type: CNM_CollectionInterfaces.TreeBalance

This property represents the balance state for this node, for details see Tree_Balance from Interfacelib

className

Type: CNM_AbstractObject.ClassName

This abstract property returns the class name of the concrete object,

leftChild

Type: CNM_CollectionInterfaces.IBinaryTreeNode

This property points to the left child of a binary tree node.

object

Type: CNM_AbstractObject.IObject

The property points to the content of the treenode.

rightChild

Type: CNM_CollectionInterfaces.IBinaryTreeNode

This property points to the right child of an binarytreeenode.

Methods

clearContents

  • Return type: VOID

This method is called in the destruct method and is intended to zero all references and interfaces that should not be destructed.

clone

This method is used to create a new instance

compareTo

This method compares a foreign object with the own one, this is needed for sort orders.

deepClone

This method is used to create a new instance

destructNodeAndAllChilds

destructs / deepdestructs all nodes in the subtrees of a specified node and this node

FB_Exit

  • Parameters:
    • bInCopyCode (BOOL): TRUE: the exit method is called in order to leave the instance which will be copied afterwards (online change).
  • Return type: BOOL

Mark the object as deleted, as it staiys in the memory.

FB_init

The constructor FB_init is needed to create an unique hash code.

Code

Declaration

{attribute 'enable_dynamic_creation'}
FUNCTION_BLOCK BalancedBinarySearchTreeNode EXTENDS AbstractDisposableContainer IMPLEMENTS CNM_CollectionInterfaces.IBalancedBinarySearchTreeNode
VAR
nodevalue :CNM_AbstractObject.IObject;
left :CNM_CollectionInterfaces.IBinaryTreeNode;
right :CNM_CollectionInterfaces.IBinaryTreeNode;
nodebalance :CNM_CollectionInterfaces.TreeBalance;
END_VAR