- newNode = new CoreNode(config, seqNb, parentSeqNb, start);
+ newNode = nodeFactory.createCoreNode(config, seqNb, parentSeqNb, start);
- newNode = new LeafNode(config, seqNb, parentSeqNb, start);
+ newNode = nodeFactory.createLeafNode(config, seqNb, parentSeqNb, start);
- if (getNodeType() == NodeType.CORE) { /* Only Core Nodes can have children */
- CoreNode thisNode = (CoreNode) this;
+ if (getNodeType() != NodeType.LEAF) { /* Only Core Nodes can have children */
+ ParentNode thisNode = (ParentNode) this;
writer.print(" " + thisNode.getNbChildren() + " children");
if (thisNode.getNbChildren() >= 1) {
writer.print(": [ " + thisNode.getChild(0));
writer.print(" " + thisNode.getNbChildren() + " children");
if (thisNode.getNbChildren() >= 1) {
writer.print(": [ " + thisNode.getChild(0));