Class 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 a StacktraceModel.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]).

    • Method Detail

      • getItemOffsetInFork

        public int getItemOffsetInFork()
      • hasTail

        public boolean hasTail()
      • selectSibling

        @Deprecated
        public StacktraceModel.Branch selectSibling​(java.lang.Integer siblingOffset)
        Deprecated.
        Will eventually be moved to UI code
        Select 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.
      • 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()