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

com.github.javaclub.toolbox.model.TreeNode Maven / Gradle / Ivy

There is a newer version: 2.7.44
Show newest version
/*
 * @(#)TreeNode.java	2023-2-2
 *
 * Copyright (c) 2023. All Rights Reserved.
 *
 */

package com.github.javaclub.toolbox.model;

import java.io.Serializable;
import java.util.List;

/**
 * TreeNode
 *
 * @author Gerald Chen
 * @version $Id: TreeNode.java 2023-2-2 9:30:05 Exp $
 */
public interface TreeNode {
	
	/**
	 * 取当前节点ID
	 *
	 * @return 当前节点ID
	 */
	Serializable getId();
	
	/**
	 * 取当前节点的父节点ID
	 *
	 * @return 父节点ID
	 */
	Serializable getParentId();
	
	/**
	 * 取当前节点的孩子节点列表
	 *
	 * @return 子节点列表
	 */
	List getChildren(); // element 就是 TreeNode 的衍生实例
	
	/**
	 * 给当前节点添加一个孩子节点
	 *
	 * @param node 节点对象
	 */
	void addChild(TreeNode node);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy