java.lang.Object
org.eclipse.tracecompass.incubator.callstack.core.base.CallStackElement
All Implemented Interfaces:
ITree, ICallStackElement

public class CallStackElement extends Object implements ICallStackElement
A basic callstack element implementing the methods of the interface.
Author:
Geneviève Bastien
  • Field Details

    • DEFAULT_SYMBOL_KEY

      public static final int DEFAULT_SYMBOL_KEY
      The default key to use for symbol resolution if none is available
      See Also:
  • Constructor Details

  • Method Details

    • getChildrenElements

      public Collection<ICallStackElement> getChildrenElements()
      Description copied from interface: ICallStackElement
      Get the elements at the next level of the callstack hierarchy from this element FIXME: Can this method be completely replace by ITree.getChildren()?
      Specified by:
      getChildrenElements in interface ICallStackElement
      Returns:
      The list of children elements in the hierarchy
    • addChild

      public void addChild(ITree child)
      Description copied from interface: ITree
      Add a child to this tree object. This method should make sure to set the parent of the child to the curent object
      Specified by:
      addChild in interface ITree
      Parameters:
      child - The child object
    • setParent

      public void setParent(@Nullable ITree parent)
      Description copied from interface: ITree
      Set the parent of this tree object
      Specified by:
      setParent in interface ITree
      Parameters:
      parent - The parent of the object, it can be null if there is no parent
    • getGroup

      public IWeightedTreeGroupDescriptor getGroup()
      Description copied from interface: ICallStackElement
      Get the corresponding group descriptor FIXME: Remove this method?
      Specified by:
      getGroup in interface ICallStackElement
      Returns:
      The group descriptor of this element
    • getName

      public String getName()
      Description copied from interface: ITree
      Get the name of this tree element, it should be human-readable as it will be displayed to the user
      Specified by:
      getName in interface ITree
      Returns:
      The name of this tree element
    • isLeaf

      public boolean isLeaf()
      Description copied from interface: ICallStackElement
      Get whether this element is a leaf element in the callstack hierarchy. Leaf elements are expected to contain the proper analysis data.
      Specified by:
      isLeaf in interface ICallStackElement
      Returns:
      Whether this element is a leaf, ie contains analysis data or not
    • getNextGroup

      public @Nullable IWeightedTreeGroupDescriptor getNextGroup()
      Description copied from interface: ICallStackElement
      Get the next group descriptor FIXME: Remove this method?
      Specified by:
      getNextGroup in interface ICallStackElement
      Returns:
      The next group descriptor, or null if this is a leaf element
    • setSymbolKeyElement

      public void setSymbolKeyElement(ICallStackElement element)
      Description copied from interface: ICallStackElement
      Set the symbol key element to use for this hierarchy
      Specified by:
      setSymbolKeyElement in interface ICallStackElement
      Parameters:
      element - The symbol key element
    • isSymbolKeyElement

      public boolean isSymbolKeyElement()
      Description copied from interface: ICallStackElement
      Return whether this element is the symbol key element
      Specified by:
      isSymbolKeyElement in interface ICallStackElement
      Returns:
      Whether the element is the symbol key
    • getSymbolKeyAt

      public final int getSymbolKeyAt(long startTime)
      Description copied from interface: ICallStackElement
      Get the key for symbol resolution at a given time
      Specified by:
      getSymbolKeyAt in interface ICallStackElement
      Parameters:
      startTime - The time at which to get the symbol key
      Returns:
      The symbol key at time
    • getParentElement

      public @Nullable ICallStackElement getParentElement()
      Description copied from interface: ICallStackElement
      Get the parent element, or null if this element corresponds to the first group of the hierarchy FIXME: Can this method be completely replace by ITree.getParent()?
      Specified by:
      getParentElement in interface ICallStackElement
      Returns:
      The parent element
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getParent

      public @Nullable ITree getParent()
      Description copied from interface: ITree
      Get the parent of this tree element
      Specified by:
      getParent in interface ITree
      Returns:
      The parent of this object
    • getChildren

      public Collection<ITree> getChildren()
      Description copied from interface: ITree
      Get the children of this object
      Specified by:
      getChildren in interface ITree
      Returns:
      A collection of children elements
    • copyElement

      public CallStackElement copyElement()
      Description copied from interface: ITree
      Create a new element that is a copy of the current object. This copy should copy only the object's data, not the hierarchy as callers of this method may want to create a new hierarchy for those elements.
      Specified by:
      copyElement in interface ITree
      Returns:
      a new element, copy of the current element