Tree Adapter
Platform-agnostic adapter that allows the layout engine to traverse any external tree structure without coupling to a specific domain model.
Identity contract
The layout algorithm relies on consistent node identity. Implementations must satisfy:
Deterministic children: children must return the same elements in the same order every time it is called for a given node. Returning freshly allocated wrapper objects that are not equal to previously returned nodes violates this contract.
Consistent parent–child relationship: For every child
creturned bychildren(node),parent(c)must returnnode(the same instance or an equal object).Unique membership: Each node must appear exactly once in the tree. Sharing a node across multiple parents or including it in multiple sibling lists is not supported.
Violating these constraints leads to undefined layout results or runtime exceptions.
Type Parameters
The node type of the external tree.