Package hu.webarticum.treeprinter
Interface TreeNode
-
- All Known Implementing Classes:
AbstractTreeNodeDecorator,BorderTreeNodeDecorator,DefaultFsTreeNodeDecorator,FsTreeNode,JustifyTreeNodeDecorator,PadTreeNodeDecorator,PlaceholderNode,ShadowTreeNodeDecorator,SimpleTreeNode,TrackingTreeNodeDecorator
public interface TreeNodeMain interface for trees and tree nodes. Any tree is given by its root node. Nodes provide their content as a string (viacontent()), and list their children (viachildren()). The other methods provide metadata, each has a default implementation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.List<TreeNode>children()Gets the list of child nodes of this node.java.lang.Stringcontent()Gets the content of this node.default Insetsinsets()Gets the content insets.default booleanisDecorable()Checks if this node can be decorated.default booleanisPlaceholder()Checks if this node is a placeholder.default TreeNodeoriginalNode()Gets the original node object.
-
-
-
Method Detail
-
content
java.lang.String content()
Gets the content of this node.
-
children
java.util.List<TreeNode> children()
Gets the list of child nodes of this node.
-
originalNode
default TreeNode originalNode()
Gets the original node object. By default, returns withthis. Decorators should return with the most inner decorated node.
-
insets
default Insets insets()
Gets the content insets. Returns with the sizes of the visual decoration around the main content. By default, this is fully zero. Visually extending decorators (border, shadow etc.) should extend the insets with the sizes of the visual extension.
-
isDecorable
default boolean isDecorable()
Checks if this node can be decorated. By default, decorators should keep non-decorable nodes untouched.
-
isPlaceholder
default boolean isPlaceholder()
Checks if this node is a placeholder. By default, genericTreePrinterimplementations hide placeholder nodes. Some types of implementation (e. g. n-ary trees) should take these into account anyway.
-
-