当前位置: 首页>>代码示例>>Java>>正文


Java Tree.getChildren方法代码示例

本文整理汇总了Java中edu.uci.ics.jung.graph.Tree.getChildren方法的典型用法代码示例。如果您正苦于以下问题:Java Tree.getChildren方法的具体用法?Java Tree.getChildren怎么用?Java Tree.getChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.uci.ics.jung.graph.Tree的用法示例。


在下文中一共展示了Tree.getChildren方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: print

import edu.uci.ics.jung.graph.Tree; //导入方法依赖的package包/类
private static void print( Tree<Parameter, Integer> tree, Parameter node ) {
	if ( log.isDebugEnabled() ) {

		StringBuilder sb = new StringBuilder( "Parameter Tree:" );
		int depth = tree.getDepth( node );
		for ( int i = 0; i < depth; i++ ) {
			sb.append( "  " );
		}
		sb.append( tree.getRoot().equals( node ) ? "<root>" : node );
		log.debug( sb.toString() );

		for ( Parameter p : tree.getChildren( node ) ) {
			print( tree, p );
		}
	}
}
 
开发者ID:Ostrich-Emulators,项目名称:semtool,代码行数:17,代码来源:BindingPanel.java

示例2: printTree

import edu.uci.ics.jung.graph.Tree; //导入方法依赖的package包/类
public static <V, E> void printTree( V root,
		Tree<V, E> tree, int depth ) {
	StringBuilder sb = new StringBuilder();
	for ( int i = 0; i < depth; i++ ) {
		sb.append( "  " );
	}
	sb.append( root );
	log.debug( sb.toString() );

	for ( V child : tree.getChildren( root ) ) {
		printTree( child, tree, depth + 1 );
	}
}
 
开发者ID:Ostrich-Emulators,项目名称:semtool,代码行数:14,代码来源:GraphToTreeConverter.java

示例3: fillInCombos

import edu.uci.ics.jung.graph.Tree; //导入方法依赖的package包/类
private void fillInCombos( Tree<Parameter, Integer> tree ) {
	// we only need to run queries for the toplevel parameters, because
	// everything else is handled by the item listener

	for ( Parameter p : tree.getChildren( tree.getRoot() ) ) {
		requery( p );
	}
}
 
开发者ID:Ostrich-Emulators,项目名称:semtool,代码行数:9,代码来源:BindingPanel.java

示例4: printCluster

import edu.uci.ics.jung.graph.Tree; //导入方法依赖的package包/类
private void printCluster(Tree<ClusterVO, ItemAssocVO<Integer,Integer>> tree, ClusterVO vertex) {
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < tree.getDepth(vertex); i++) {
        sb.append("  ");
    }
    logger.info(sb.toString() + vertex.getName());
    Collection<ClusterVO> children = tree.getChildren(vertex);
    for (ClusterVO clusterVO : children) {
        printCluster(tree, clusterVO);
    }
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:12,代码来源:ClusterServiceTest.java

示例5: writeNode

import edu.uci.ics.jung.graph.Tree; //导入方法依赖的package包/类
private ClusterNode writeNode(Tree<ClusterVO, ItemAssocVO<Integer,Integer>> tree,
                       ClusterVO node, ClusterVO root) {
    
    ClusterNode n = new ClusterNode();
    n.setData(node.getName());
    NodeAttributes na = new NodeAttributes(node.getName(), node.getDescription() == null ? node.getName() : node.getDescription());
    n.setAttr(na);
    
    if (node == root) {
        n.setRel("root");
    }
    
    if (!Strings.isNullOrEmpty(node.getDescription())) {
        n.setDescription(node.getDescription());
    }
    
    Collection<ClusterVO> children = tree.getChildren(node);
    if (children.size() > 0) {
        ArrayList<ClusterNode> childNodes = new ArrayList<>(); 
    
        for (ClusterVO child : children) {
            ClusterNode cn = writeNode(tree,child, root);
            childNodes.add(cn);
        }
        n.setChildren(childNodes);
    }
    
    return n;

}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:31,代码来源:ClusterManagerController.java

示例6: writeNode

import edu.uci.ics.jung.graph.Tree; //导入方法依赖的package包/类
private void writeNode(Tree<ClusterVO, ItemAssocVO<Integer,Integer>> tree,
                       ClusterVO node, JSONWriter writer, ClusterVO root) throws JSONException {
    writer.object()
            .key("data").value(node.getName())
            .key("attr")
            .object()
            .key("id")
            .value(node.getName())
            .key("title")
            .value(node.getDescription() == null ? node.getName() : node.getDescription());

    if (node == root)
        writer.key("rel").value("root");

    writer.endObject();

    if (!Strings.isNullOrEmpty(node.getDescription()))
        writer.key("description").value(node.getDescription());

    Collection<ClusterVO> children = tree.getChildren(node);

    if (children.size() > 0) {
        writer.key("children")
                .array();

        for (ClusterVO child : children) {
            writeNode(tree, child, writer, root);
        }

        writer.endArray();
    }

    writer.endObject();
}
 
开发者ID:customertimes,项目名称:easyrec-PoC,代码行数:35,代码来源:ClusterManagerController.java


注:本文中的edu.uci.ics.jung.graph.Tree.getChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。