All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.onetwo.common.tree.TreeUtils Maven / Gradle / Ivy

There is a newer version: 4.7.2
Show newest version
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