Generic tree implementation in Java

后端 未结 10 1287
甜味超标
甜味超标 2020-12-28 12:29

Is anyone aware of a generic tree (nodes may have multiple children) implementation for Java? It should come from a well trusted source and must be fully tested.

10条回答
  •  梦毁少年i
    2020-12-28 13:15

    I use an XML DOM (XML describes a tree structure) and specifically the Open Source XOM (http://www.xom.nu). This is lightweight, nodes can be subclassed if required and very highly used and tested. It may be larger than you require but it has the advantage that any tree navigation methods (ancestors, siblings, etc.) are fully managed through XPath. You can also serialize the tree and transform it by tested XML methods. There is also a strong user community

提交回复
热议问题