Line | |
---|
1 | unit GenericTree;
|
---|
2 |
|
---|
3 | {$mode delphi}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | GenericList;
|
---|
9 | {
|
---|
10 | type
|
---|
11 | TGTreeNode<T> = class
|
---|
12 | type
|
---|
13 | TTreeNodeType = TGTreeNode<T>;
|
---|
14 | var
|
---|
15 | Childs: TGList<TTreeNodeType>;
|
---|
16 | Value: T;
|
---|
17 | procedure Clear;
|
---|
18 | end;
|
---|
19 |
|
---|
20 | TGTree<T> = class
|
---|
21 | TopItem: TGTreeNode<T>;
|
---|
22 | procedure Clear;
|
---|
23 | end;
|
---|
24 | }
|
---|
25 |
|
---|
26 | implementation
|
---|
27 |
|
---|
28 | (*
|
---|
29 | { TGTreeNode }
|
---|
30 |
|
---|
31 | procedure TGTreeNode<T>.Clear;
|
---|
32 | begin
|
---|
33 | Childs.Clear;
|
---|
34 | end;
|
---|
35 |
|
---|
36 | { TGTree }
|
---|
37 |
|
---|
38 | procedure TGTree<T>.Clear;
|
---|
39 | begin
|
---|
40 | if Assigned(TopItem) then TopItem.Clear;
|
---|
41 | end;
|
---|
42 |
|
---|
43 | *)
|
---|
44 |
|
---|
45 | end.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.