/** * Creates a new SpanTree with a given root node. * * @param name the name of the span tree * @param root the root node of the span tree * @throws IllegalStateException if the root node is invalid */ public SpanTree(String name, SpanNode root) { this.name = name; setRoot(root); }
/** * Creates a new SpanTree with the given name and an empty SpanList as its root node. * * @param name the name of the span tree */ public SpanTree(String name) { this.name = name; setRoot(new SpanList()); }
@SuppressWarnings("unchecked") public SpanTree(SpanTree otherToCopy) { name = otherToCopy.name; setRoot(copySpan(otherToCopy.root)); List<Annotation> annotationsToCopy = new ArrayList<Annotation>(otherToCopy.getAnnotations()); List<Annotation> newAnnotations = new ArrayList<Annotation>(annotationsToCopy.size());
tree.setRoot(root);
tree.setRoot(root);