Open.Hierarchy 1.6.2

Interfaces and classes helful in managing tree-like data structures.

Part of the "Open" set of libraries.

Install-Package Open.Hierarchy -Version 1.6.2
dotnet add package Open.Hierarchy --version 1.6.2
<PackageReference Include="Open.Hierarchy" Version="1.6.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Open.Hierarchy --version 1.6.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Open.Hierarchy

Node

One of the important abilities of Node and its supporting classes is to allow for creating and modifying tree structures that only have a parent to child relationship. It's important to ensure that a node cannot occur multiple times in a tree but an instance of its value can occur any number of times. This facilitates potential 'value sub-trees' that can have duplicate references but not duplicate instances. By using Node as a container, a single instance can exist multiple times in a tree but still be uniquely identifiable by its position.

Node.Factory

Blank Instance

Calling .GetBlankNode() will retrieve a blank node from the underlying object pool or create a new one.

Mapping

Calling .Map(root) generates node hierarchy map based upon if the root or any of its children implement IParent.

Cloning

Calling .Clone(node) creates a copy of the node map.

Recycling

Node instances can be recycled by calling the Factory.Recycle(node) method. The node itself and its children are torn down and recycled to an object pool.

WARNING: The Factory.Recycle(node) method is the one point of potential trouble if multiple references are retained. It must be used with care.

Open.Hierarchy

Node

One of the important abilities of Node and its supporting classes is to allow for creating and modifying tree structures that only have a parent to child relationship. It's important to ensure that a node cannot occur multiple times in a tree but an instance of its value can occur any number of times. This facilitates potential 'value sub-trees' that can have duplicate references but not duplicate instances. By using Node as a container, a single instance can exist multiple times in a tree but still be uniquely identifiable by its position.

Node.Factory

Blank Instance

Calling .GetBlankNode() will retrieve a blank node from the underlying object pool or create a new one.

Mapping

Calling .Map(root) generates node hierarchy map based upon if the root or any of its children implement IParent.

Cloning

Calling .Clone(node) creates a copy of the node map.

Recycling

Node instances can be recycled by calling the Factory.Recycle(node) method. The node itself and its children are torn down and recycled to an object pool.

WARNING: The Factory.Recycle(node) method is the one point of potential trouble if multiple references are retained. It must be used with care.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.6.2 42 7/4/2019
1.6.1 40 7/3/2019