public final class ItemTreeToolkit
extends java.lang.Object
Constructor and Description |
---|
ItemTreeToolkit() |
Modifier and Type | Method and Description |
---|---|
private static void |
appendLayerBreakdown(java.lang.StringBuilder report,
IQuantity firstLayerDuration,
LayerBreakdownVisitor.LayerBreakdown breakdown) |
static void |
appendLayeredBreakdown(java.lang.StringBuilder report,
ITreeNode<IItem> root,
int maxDepth)
Reports all encapsulation layers.
|
static void |
appendLongestBreakdown(java.lang.StringBuilder report,
ITreeNode<IItem> root)
Renders a report of the longest encapsulating event chain.
|
static int |
getDepth(ITreeNode<?> node)
Returns the number of ancestors the node has.
|
(package private) static boolean |
hasDuration(IItem item) |
static java.lang.String |
printTree(ITreeNode<IItem> node) |
private static java.lang.Object |
toString(IQuantity duration) |
public static java.lang.String printTree(ITreeNode<IItem> node)
static boolean hasDuration(IItem item)
public static void appendLongestBreakdown(java.lang.StringBuilder report, ITreeNode<IItem> root)
If we have A -> (B->D, C->E) and B has longer duration than C, the report will be A => B => D.
report
- the report to write toroot
- the root node to start frompublic static void appendLayeredBreakdown(java.lang.StringBuilder report, ITreeNode<IItem> root, int maxDepth)
If A -> (B->D, C->E), the report will show:
report
- the report to write toroot
- the root node to start the analysis frommaxDepth
- maximum number of layers to analyzeprivate static void appendLayerBreakdown(java.lang.StringBuilder report, IQuantity firstLayerDuration, LayerBreakdownVisitor.LayerBreakdown breakdown)
private static java.lang.Object toString(IQuantity duration)
public static int getDepth(ITreeNode<?> node)
node
- the node for which to calculate the depth