forked from actframework/actframework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTreeNode.java
More file actions
35 lines (29 loc) · 781 Bytes
/
TreeNode.java
File metadata and controls
35 lines (29 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package act.cli.tree;
import act.cli.view.CliView;
import java.util.List;
/**
* Defines an abstract tree node that can be printed
* using {@link CliView#TREE Tree view}
*/
public interface TreeNode {
/**
* Returns {@code id} of this node.
* <p>
* The {@code id} of a node can be used to identify a
* node in a certain context In other words children
* nodes of the same parent node cannot share a same id
* </p>
* @return the node id
*/
public String id();
/**
* Returns the label on the current tree node
* @return the label string
*/
public String label();
/**
* Returns a list of child tree node
* @return the children list
*/
public List<TreeNode> children();
}