首页 > 其他分享 >节点反向追加得到根

节点反向追加得到根

时间:2022-11-24 14:37:22浏览次数:37  
标签:currentNode temp rootTreeNode writeLog 反向 追加 TreeNode 节点 getNodeLabel



节点反向追加得到根_分布式


image.png


INode currentNode = this.keybutton.keyEntry;
TreeNode rootTreeNode = null;
while (currentNode != null)
{
//list.AddFirst(currentNode);
LogUtil.writeLog("获取当前:" + currentNode.getNodeLabel());
if (rootTreeNode != null)
{
TreeNode temp = rootTreeNode;
LogUtil.writeLog("操作节点:" + temp.Name);
rootTreeNode = new TreeNode(currentNode.getNodeLabel(), new TreeNode[] { temp });
LogUtil.writeLog("操作节点:" + temp.Name + "追加" + currentNode.getNodeLabel());
}
else
{
rootTreeNode = new TreeNode(currentNode.getNodeLabel());
LogUtil.writeLog("子节点" + currentNode.getNodeLabel());
}
currentNode = currentNode.getParent();

}

标签:currentNode,temp,rootTreeNode,writeLog,反向,追加,TreeNode,节点,getNodeLabel
From: https://blog.51cto.com/u_15458814/5883897

相关文章