/** * Recursively sorts all children by occurrence in the text covered. */ public void sortChildrenRecursive() { for (SpanNode node : children()) { if (node instanceof SpanList) { ((SpanList) node).sortChildrenRecursive(); } Collections.sort(children()); } }
/** * Recursively sorts all children in subtree i by occurrence in the text covered. * * @param i the index of the subtree to sort recursively */ public void sortChildrenRecursive(int i) { Children children = childTrees.get(i); for (SpanNode node : children.children()) { if (node instanceof SpanList) { ((SpanList) node).sortChildrenRecursive(); } } Collections.sort(children.children()); }
/** * Recursively sorts all children in <strong>all</strong> subtrees by occurrence in the text covered. */ public void sortChildrenRecursive() { for (Children children : childTrees) { for (SpanNode node : children.children()) { if (node instanceof SpanList) { ((SpanList) node).sortChildrenRecursive(); } } Collections.sort(children.children()); } }