/** * Clones the tree and removes root node of the tree. Due to cloning * the given tree is not modified * * @param sourceTree the source tree * @return clone of the soruce treee without root */ public static Tree deleteRootNode(Tree sourceTree) { return deleteRootNode(sourceTree, true); }
/** * Clones all trees and removes the root nodes from the clones. The given source trees * are not manipulated * * @param sourceTrees the source trees * @return clones the clones without roots */ public static List<Tree> deleteRootNodes(List<Tree> sourceTrees) { List<Tree> trees = new ArrayList<Tree>(sourceTrees.size()); for (Tree t : sourceTrees) { trees.add(deleteRootNode(t)); } return trees; }