org.onetwo.common.tree.TreeUtils Maven / Gradle / Ivy
package org.onetwo.common.tree;
import java.util.List;
final public class TreeUtils {
public static , T> TreeBuilder newBuilder(List datas, TreeModelCreator treeNodeCreator){
return new TreeBuilder(datas, treeNodeCreator);
}
public static > void buildString(StringBuilder str, TreeModel node, String sp){
str.append(node.getId()).append("\n");
if(node.getChildren()==null)
return ;
for(T cnode : node.getChildren()){
str.append(sp);
sp += sp;
buildString(str, cnode, sp);
}
}
private TreeUtils(){
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy