Interface Treeable<T,ID>
- Type Parameters:
T- the node type | 节点类型ID- the ID type | ID类型
- All Known Implementing Classes:
DefaultTreeNode, VirtualTree
public interface Treeable<T,ID>
Treeable Interface
可树化接口
Interface for objects that can be organized into a tree structure.
可组织成树形结构的对象接口。
Features | 主要功能:
- Define tree node contract with ID and parent ID - 定义带ID和父ID的树节点契约
- Children list management - 子节点列表管理
- Compatible with OpenTree operations - 兼容OpenTree操作
Usage Examples | 使用示例:
// Implement Treeable - 实现Treeable
public class Department implements Treeable<Department, Long> {
private Long id;
private Long parentId;
private List<Department> children;
// implement getId(), getParentId(), getChildren(), setChildren()
}
Security | 安全性:
- Thread-safe: Depends on implementation - 线程安全: 取决于实现
- Null-safe: Depends on implementation - 空值安全: 取决于实现
- Since:
- JDK 25, opencode-base-tree V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGet the children list 获取子节点列表getId()Get the node ID 获取节点IDGet the parent node ID 获取父节点IDvoidsetChildren(List<T> children) Set the children list 设置子节点列表
-
Method Details
-
getId
-
getParentId
-
getChildren
-
setChildren
-