Skip to content

TNodeDictionary (generic Tree dictionary) #2

@davidberneda

Description

@davidberneda

It is currently possible to create a Tree of dictionary nodes, for example:

uses
   System.Generic.Collections;

type
  TMyTree = TNode<TDictionary<String, TButton>>;

In this way, each node "Data" property is a TDictionary that can be used as normal.

However, this is different than having a Tree structure where the children nodes are unique, and accessible using the desired "Key", for example.

type
  TMyTree = TNodeDictionary<String, Integer>;

var 
  Root : TMyTree;
...
  Root['America'].Data := 123;
  Root['America']['USA'].Data := 456;

In the above code, "USA" is a unique children node of "America", and each node has a "Data" property of type Integer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions