Changed list of children to a combination of LinkedList and HashMap for
easier index access and modification
Method added to get children keys
Methods for adding children as TreeNode or a collection of TreeNodes
- Value-only constructor removed
- Constructor with parent tree node set to protected
- New constructor with key and value
- Adding a TreeNode as child throws a TreeNodeException if that TreeNode
has already been added as child to another node
- Better method names which all include "Node" to avoid confusion when
extending TreeNode
- Improved node removing with consistency check since a map and a list
is used in parallel
- Method to get the node level
- Added a visibility flag. A node can be defined as invisible with
setInvisibleNode and thus will have the level of the next visible
parent. Any code getting the parent or child nodes will still have to
make the decision what to do with invisible nodes.
New method to retrieve the node index within the child nodes
New methods for getting the previous and next node, and checking if a
child node with a certain key exists
Simple printer without comparator and a new method print() in the
TreeNode which can be overwritten to customize the data to print in the
tree