Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Delphi implementation of the Celko "nested sets" approach to represent a hierarchy in a relational DB.

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 .gitignore
Octocat-spinner-32 .hgignore
Octocat-spinner-32 NestedSetTests.dpr
Octocat-spinner-32 NestedSetTests.dproj
Octocat-spinner-32 Readme.txt
Octocat-spinner-32 license.txt
Octocat-spinner-32 uNester.pas
Octocat-spinner-32 uNesterTests.pas
Kyle's Adjacency -> Nested Sets Translator

Copyright 2007 Kyle Cordes

This class converts an "Adjacency" hierarchy representation in to a
"nested set" representation.  Search the web for Joe Celko's nested set
articles to learn what that means.

This assumes that nodes are identified by ints. You could change it to use
strings etc. as needed, of course.

To use this class:

  * create an instance. instances are single-shot, one use.

  * call "AddNode" 0..N times, once for each node.

  * call Convert.  The processing will occur, and your handler
    will be called once for each node, with the Left and Right values.

Enjoy. I'd love to hear if anyone finds this useful.
Something went wrong with that request. Please try again.