Class StacktraceModel.Branch
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.stacktrace.StacktraceModel.Branch
-
- Enclosing class:
- StacktraceModel
public class StacktraceModel.Branch extends java.lang.Object
A branch is a sequence of frames without any forks. It is preceded by aStacktraceModel.Fork
and ends with a fork.When first constructed, the branch only has the first frame calculated. On demand, a list of non-branching "tail" frames and a fork after the branch can be calculated and retrieved.
Note that all frames within a branch do not necessarily have the same number of items. Stack traces that are similar in all aspects except for their sizes (e.g. [a, b] and [a, b, c]) can share a branch. Forks are only created if there are two or more different frames on the same level (e.g. [a, b, c] and [a, b, d]).
-
-
Field Summary
Fields Modifier and Type Field Description private StacktraceModel.Fork
branchEnding
private StacktraceFrame
firstFrame
private java.lang.Boolean
hasTail
private int
itemOffsetInFork
private StacktraceModel.Fork
parentFork
private int
siblingIndex
private StacktraceFrame[]
tailFrames
-
Constructor Summary
Constructors Modifier Constructor Description private
Branch(StacktraceModel.Fork parent, SimpleArray<IItem> items, IMCFrame frame, int siblingIndex, int itemOffsetInFork)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private StacktraceFrame[]
buildTail()
private boolean
calculateHasTail()
StacktraceModel.Fork
getEndFork()
StacktraceFrame
getFirstFrame()
int
getItemOffsetInFork()
StacktraceFrame
getLastFrame()
StacktraceModel.Fork
getParentFork()
StacktraceFrame[]
getTailFrames()
boolean
hasTail()
StacktraceModel.Branch
selectSibling(java.lang.Integer siblingOffset)
Deprecated.Will eventually be moved to UI code
-
-
-
Field Detail
-
parentFork
private final StacktraceModel.Fork parentFork
-
firstFrame
private final StacktraceFrame firstFrame
-
siblingIndex
private final int siblingIndex
-
itemOffsetInFork
private final int itemOffsetInFork
-
hasTail
private java.lang.Boolean hasTail
-
tailFrames
private StacktraceFrame[] tailFrames
-
branchEnding
private StacktraceModel.Fork branchEnding
-
-
Constructor Detail
-
Branch
private Branch(StacktraceModel.Fork parent, SimpleArray<IItem> items, IMCFrame frame, int siblingIndex, int itemOffsetInFork)
-
-
Method Detail
-
getItemOffsetInFork
public int getItemOffsetInFork()
-
getParentFork
public StacktraceModel.Fork getParentFork()
-
hasTail
public boolean hasTail()
-
selectSibling
@Deprecated public StacktraceModel.Branch selectSibling(java.lang.Integer siblingOffset)
Deprecated.Will eventually be moved to UI codeSelect a sibling branch. This sets the selection state on the parent forks.- Parameters:
siblingOffset
- Use 1 or -1 to select the next or previous sibling branch. If 0, then this branch is selected. If null, clear branch selection.- Returns:
- The newly selected branch. Null if branch selection was cleared.
-
getFirstFrame
public StacktraceFrame getFirstFrame()
-
getLastFrame
public StacktraceFrame getLastFrame()
- Returns:
- The last frame in this branch. If the branch length is 1, then this will be equal to the first frame.
-
getTailFrames
public StacktraceFrame[] getTailFrames()
- Returns:
- Get non-branching tail frames in this branch. If you are building a UI where you are not interested in non-branching frames, then you may want to ignore the tail.
-
getEndFork
public StacktraceModel.Fork getEndFork()
- Returns:
- the fork with branches following this branch
-
calculateHasTail
private boolean calculateHasTail()
-
buildTail
private StacktraceFrame[] buildTail()
-
-