/** * Remove all trace information and set the trace level to 0. * * @return This, to allow chaining. */ public Trace clear() { level = 0; root = new TraceNode(); return this; }
/** * Adds a child node to this. * * @param child The child to add. * @return This, to allow chaining. */ public TraceNode addChild(TraceNode child) { if (note != null) { throw new IllegalStateException("Nodes with notes are leaf nodes, you can not add children to it."); } TraceNode node = new TraceNode(child); node.parent = this; children.add(node); return this; }
/** * Convenience method to add a child node containing a note to this. * * @param note The note to assign to the child. * @return This, to allow chaining. */ public TraceNode addChild(String note) { return addChild(new TraceNode(note)); }
return new TraceNode(); TraceNode proxy = new TraceNode(); TraceNode node = proxy; StringBuilder note = null; note = new StringBuilder(); } else if (c == '(' || c == '{') { node.addChild(new TraceNode()); node = node.getChild(node.getNumChildren() - 1); node.setStrict(c == '('); if (node == null) { log.log(LogLevel.WARNING, "Unexpected closing brace in trace '" + str + "' at position " + i + "."); return new TraceNode(); return new TraceNode(); return new TraceNode(); return new TraceNode(); return new TraceNode();
/** * Normalize this tree. This will transform all equivalent trees into the same form. Note that this will also * perform an implicit compaction of the tree. * * @return This, to allow chaining. */ public TraceNode normalize() { compact(); sort(); if (note != null || !strict) { TraceNode child = new TraceNode(); child.swap(this); addChild(child); strict = true; } return this; }
TraceNode tail = new TraceNode(); for (RoutingNode child : children) { TraceNode root = child.trace.getRoot();