Class TrackingTreeNodeDecorator
- java.lang.Object
-
- hu.webarticum.treeprinter.decorator.AbstractTreeNodeDecorator
-
- hu.webarticum.treeprinter.decorator.TrackingTreeNodeDecorator
-
- All Implemented Interfaces:
TreeNode
public class TrackingTreeNodeDecorator extends AbstractTreeNodeDecorator
Helper decorator implementation ofTreeNodethat tracks its position in the tree
-
-
Field Summary
Fields Modifier and Type Field Description intindexTrackingTreeNodeDecoratorparent-
Fields inherited from class hu.webarticum.treeprinter.decorator.AbstractTreeNodeDecorator
baseNode, decorable, inherit
-
-
Constructor Summary
Constructors Constructor Description TrackingTreeNodeDecorator(TreeNode baseNode)TrackingTreeNodeDecorator(TreeNode baseNode, TrackingTreeNodeDecorator parent, int index)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringdecoratedContent()booleanequals(java.lang.Object other)inthashCode()booleanisDecorable()Checks if this node can be decorated.protected TreeNodewrapChild(TreeNode childNode, int index)-
Methods inherited from class hu.webarticum.treeprinter.decorator.AbstractTreeNodeDecorator
children, content, getDecoratedNode, insets, isPlaceholder, originalNode
-
-
-
-
Field Detail
-
parent
public final TrackingTreeNodeDecorator parent
-
index
public final int index
-
-
Constructor Detail
-
TrackingTreeNodeDecorator
public TrackingTreeNodeDecorator(TreeNode baseNode)
-
TrackingTreeNodeDecorator
public TrackingTreeNodeDecorator(TreeNode baseNode, TrackingTreeNodeDecorator parent, int index)
-
-
Method Detail
-
decoratedContent
public java.lang.String decoratedContent()
- Specified by:
decoratedContentin classAbstractTreeNodeDecorator
-
wrapChild
protected TreeNode wrapChild(TreeNode childNode, int index)
- Specified by:
wrapChildin classAbstractTreeNodeDecorator
-
isDecorable
public boolean isDecorable()
Description copied from interface:TreeNodeChecks if this node can be decorated. By default, decorators should keep non-decorable nodes untouched.- Specified by:
isDecorablein interfaceTreeNode- Overrides:
isDecorablein classAbstractTreeNodeDecorator
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
-