Skip to content

TAVLTree.Compare

Compare 2 nodes.

Declaration

Source position: avl_tree.pp line 145

public 
function TAVLTree.Compare(Data1: Pointer; Data2: Pointer) : Integer;

Description

Compare compares the keys from 2 data pointers. It uses the appropriate compare function TAVLtree.OnCompare or TAVLTree.OnObjectCompare to do so. The result is

  • negative if the first key comes before the second
  • 0 when the two keys are equal.
  • positive if the second key comes before the first

See also

Name Description
TAVLTree.OnObjectCompare Compare handler.
TAVLtree.OnCompare Compare function used when comparing nodes.