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


Java DelegateTree.getChildren方法代码示例

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


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

示例1: removeClustersFromDB

import edu.uci.ics.jung.graph.DelegateTree; //导入方法依赖的package包/类
private void removeClustersFromDB(
        DelegateTree<ClusterVO, ItemAssocVO<Integer,Integer>> tree,
        ClusterVO vertex) {
    List<ItemAssocVO<Integer,Integer>> edges =
            itemAssocService.getItemAssocsForItem(vertex.getItem().getTenant(), vertex.getItem(), null);
    //remove all edges in db
    for (ItemAssocVO<Integer,Integer> edge : edges) {
        itemAssocService.removeItemAssoc(edge.getId());
    }
    profileDAO.deactivateProfile(vertex.getItem().getTenant(), vertex.getItem().getItem(),
            vertex.getItem().getType());
    // remove all items from cluster
    for (ItemVO<Integer, Integer> item : getItemsOfCluster(vertex)) {
        try {
            removeItemFromCluster(vertex, item);
        } catch (ClusterException ce) {
            logger.error(ce.getMessage());
        }
    }
    for (ClusterVO child : tree.getChildren(vertex)) {
        removeClustersFromDB(tree, child);
    }
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:24,代码来源:ClusterServiceImpl.java

示例2: renameCluster

import edu.uci.ics.jung.graph.DelegateTree; //导入方法依赖的package包/类
public void renameCluster(Integer tenantId, String clusterName, String newName) throws ClusterException {
    ClusterVO cluster = loadCluster(tenantId, idMappingDAO.lookup(clusterName),
            itemTypeDAO.getIdOfType(tenantId, ClusterService.ITEMTYPE_CLUSTER));
    DelegateTree<ClusterVO, ItemAssocVO<Integer,Integer>> tree =
            clusters.get(tenantId);
    if (tree.isRoot(cluster)) throw new ClusterException("ROOT cluster cannot be renamed!");
    ClusterVO parent = tree.getParent(cluster);
    ClusterVO newCluster = new ClusterVO(tenantId, idMappingDAO.lookup(newName),
            itemTypeDAO.getIdOfType(tenantId, ClusterService.ITEMTYPE_CLUSTER), newName, cluster.getDescription());
    // add the new cluster
    addCluster(newCluster, parent);
    // move all children to the new cluster
    for (ClusterVO child : tree.getChildren(cluster)) {
        moveCluster(tenantId, child.getName(), newName);
    }
    if (logger.isDebugEnabled()) {
        logger.debug("removed all children: " + tree.isLeaf(cluster));
    }

    // move all items to the new cluster
    for (ItemVO<Integer, Integer> item : getItemsOfCluster(cluster)) {
        addItemToCluster(newCluster, item);
    }

    // delete the old cluster
    removeCluster(tenantId, clusterName);

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

示例3: getSiblings

import edu.uci.ics.jung.graph.DelegateTree; //导入方法依赖的package包/类
public List<ClusterVO> getSiblings(Integer tenantId, ClusterVO cluster) {
    DelegateTree<ClusterVO, ItemAssocVO<Integer,Integer>> tree =
            clusters.get(tenantId);
    if (tree.isRoot(cluster)) return null; //root has no siblings
    ClusterVO parent = tree.getParent(cluster);
    Collection<ClusterVO> sibl = tree.getChildren(parent);
    List<ClusterVO> siblings = new ArrayList<ClusterVO>();
    for (ClusterVO clusterVO : sibl) {
        if (!clusterVO.equals(cluster)) siblings.add(clusterVO);
    }
    return siblings;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:13,代码来源:ClusterServiceImpl.java


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