Class CallStackElement
java.lang.Object
org.eclipse.tracecompass.incubator.callstack.core.base.CallStackElement
- All Implemented Interfaces:
ITree
,ICallStackElement
A basic callstack element implementing the methods of the interface.
- Author:
- Geneviève Bastien
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The default key to use for symbol resolution if none is available -
Constructor Summary
ConstructorDescriptionCallStackElement
(String name, IWeightedTreeGroupDescriptor descriptor) ConstructorCallStackElement
(String name, IWeightedTreeGroupDescriptor descriptor, @Nullable IWeightedTreeGroupDescriptor nextGroup, @Nullable ICallStackElement parent) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a child to this tree object.Create a new element that is a copy of the current object.Get the children of this objectGet the elements at the next level of the callstack hierarchy from this element FIXME: Can this method be completely replace byITree.getChildren()
?getGroup()
Get the corresponding group descriptor FIXME: Remove this method?getName()
Get the name of this tree element, it should be human-readable as it will be displayed to the user@Nullable IWeightedTreeGroupDescriptor
Get the next group descriptor FIXME: Remove this method?@Nullable ITree
Get the parent of this tree element@Nullable ICallStackElement
Get the parent element, ornull
if this element corresponds to the first group of the hierarchy FIXME: Can this method be completely replace byITree.getParent()
?final int
getSymbolKeyAt
(long startTime) Get the key for symbol resolution at a given timeboolean
isLeaf()
Get whether this element is a leaf element in the callstack hierarchy.boolean
Return whether this element is the symbol key elementvoid
Set the parent of this tree objectvoid
setSymbolKeyElement
(ICallStackElement element) Set the symbol key element to use for this hierarchytoString()
-
Field Details
-
DEFAULT_SYMBOL_KEY
public static final int DEFAULT_SYMBOL_KEYThe default key to use for symbol resolution if none is available- See Also:
-
-
Constructor Details
-
CallStackElement
Constructor- Parameters:
name
- The name of this elementdescriptor
- The corresponding group descriptor
-
CallStackElement
public CallStackElement(String name, IWeightedTreeGroupDescriptor descriptor, @Nullable IWeightedTreeGroupDescriptor nextGroup, @Nullable ICallStackElement parent) Constructor- Parameters:
name
- The name of this elementdescriptor
- The corresponding group descriptornextGroup
- The next group descriptorparent
- The parent element
-
-
Method Details
-
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 byITree.getChildren()
?- Specified by:
getChildrenElements
in interfaceICallStackElement
- Returns:
- The list of children elements in the hierarchy
-
addChild
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 -
setParent
Description copied from interface:ITree
Set the parent of this tree object -
getGroup
Description copied from interface:ICallStackElement
Get the corresponding group descriptor FIXME: Remove this method?- Specified by:
getGroup
in interfaceICallStackElement
- Returns:
- The group descriptor of this element
-
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 -
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 interfaceICallStackElement
- Returns:
- Whether this element is a leaf, ie contains analysis data or not
-
getNextGroup
Description copied from interface:ICallStackElement
Get the next group descriptor FIXME: Remove this method?- Specified by:
getNextGroup
in interfaceICallStackElement
- Returns:
- The next group descriptor, or
null
if this is a leaf element
-
setSymbolKeyElement
Description copied from interface:ICallStackElement
Set the symbol key element to use for this hierarchy- Specified by:
setSymbolKeyElement
in interfaceICallStackElement
- 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 interfaceICallStackElement
- 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 interfaceICallStackElement
- Parameters:
startTime
- The time at which to get the symbol key- Returns:
- The symbol key at time
-
getParentElement
Description copied from interface:ICallStackElement
Get the parent element, ornull
if this element corresponds to the first group of the hierarchy FIXME: Can this method be completely replace byITree.getParent()
?- Specified by:
getParentElement
in interfaceICallStackElement
- Returns:
- The parent element
-
toString
-
getParent
Description copied from interface:ITree
Get the parent of this tree element -
getChildren
Description copied from interface:ITree
Get the children of this object- Specified by:
getChildren
in interfaceITree
- Returns:
- A collection of children elements
-
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 interfaceITree
- Returns:
- a new element, copy of the current element
-