Interface IWeightedTreeProvider<N,E,T extends WeightedTree<N>>
- Type Parameters:
N
- The type of objects represented by each node in the treeE
- The type of elements used to group the trees. If this type extendsITree
, then the elements and their associated weighted trees will be grouped in a hierarchical styleT
- The type of the tree provided
- All Known Subinterfaces:
ICallGraphProvider
- All Known Implementing Classes:
DifferentialWeightedTreeProvider
,InstrumentedCallStackAnalysis
,LttngUstCallStackAnalysis
,ProfilingCallGraphAnalysisModule
public interface IWeightedTreeProvider<@NonNull N,E,@NonNull T extends WeightedTree<@NonNull N>>
An interface that classes and analyses providing weighted trees can
implement. This interface allows to add extra information about the specific
trees that it provides.
The trees are associated with elements that are used to group them. The
elements can implement the
ITree
class if there is a hierarchy in the
groupings.- Author:
- Geneviève Bastien
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
The type of data that a value represents.static class
This class associate a title to a data type for tree metrics -
Field Summary
Modifier and TypeFieldDescriptionstatic final IWeightedTreeProvider.MetricType
The default metric type for the tree's weight -
Method Summary
Modifier and TypeMethodDescriptiondefault Object
getAdditionalMetric
(@NonNull T object, int metricIndex) Get an additional metric for a tree.default List<IWeightedTreeProvider.MetricType>
Get a list of additional metrics that are provided by this tree.Return a list of additional data sets' titles.default @Nullable IWeightedTreeGroupDescriptor
Get the group descriptors that describe the hierarchical groups of elements.default IDataPalette
Weighted tree providers can provide a palette of styles for the data represented.default @Nullable IWeightedTreeSet<N,
E, T> getSelection
(ITmfTimestamp start, ITmfTimestamp end) Get a weighted tree set for a time selection.default @Nullable IStatistics<?>
getStatistics
(@NonNull T object, int metricIndex) Get the statistics for a metric.getTitle()
A title for this tree provider.Get the complete tree set provided by this object.default IWeightedTreeProvider.MetricType
Get the metric type for the weight value.default String
toDisplayString
(@NonNull T tree) Get a user-facing text to identify a tree object.
-
Field Details
-
WEIGHT_TYPE
The default metric type for the tree's weight
-
-
Method Details
-
getSelection
Get a weighted tree set for a time selection. It should be a subset of the complete tree, ie the elements, and weights of the weighted trees should be included in full tree, but its range should cover only the requested time range. If this provider does not support selection range,null
should be returned.- Parameters:
start
- The timestamp of the start of the rangeend
- The timestamp of the end of the range- Returns:
- A weighted tree set that spans the selected range, or
null
if range is not supported.
-
getTreeSet
IWeightedTreeSet<N,E, getTreeSet()T> Get the complete tree set provided by this object.- Returns:
- The complete weighted tree set
-
getWeightType
Get the metric type for the weight value. The default metric is called "Weight" and is a number- Returns:
- The metric type for the weight value.
-
getAdditionalMetrics
Get a list of additional metrics that are provided by this tree.- Returns:
- A list of metrics provided by the trees, in addition to the weight
-
getAdditionalMetric
Get an additional metric for a tree. The metric index corresponds to the position of the desired metric in the list of metric returned by thegetAdditionalMetrics()
method and the return value should be of the proper data type- Parameters:
object
- The tree object for which to get the metricmetricIndex
- The index in the list of the metric metric to get- Returns:
- The value of the metric for the tree in parameter
-
getStatistics
Get the statistics for a metric. The metric index corresponds to the position of the desired metric in the list of metric returned by thegetAdditionalMetrics()
method. If the index < 0, then the metric is the main weight.- Parameters:
object
- The weighted tree object for which to get the metricmetricIndex
- The index in the list of the metric metric to get. If < 0, then the metric is the main weight- Returns:
- The statistics for the metric of
null
if there are no statistics for this metric.
-
getExtraDataSets
Return a list of additional data sets' titles. These sets will be available by callingWeightedTree.getExtraDataTrees(int)
on the trees, where the index in the list is the parameter that the children set should match- Returns:
- The title of each child set
-
toDisplayString
Get a user-facing text to identify a tree object. By default, it is the string representation of the object.- Parameters:
tree
- The tree whose value to display- Returns:
- A user-facing string to identify this node
-
getTitle
String getTitle()A title for this tree provider. This title will be visible by users and should describe what this tree provider's data represent.- Returns:
- The title of this provider
-
getGroupDescriptor
Get the group descriptors that describe the hierarchical groups of elements. This method returnsnull
if the elements are notITree
instances. If the elements implement theITree
interface, the implementations may override this method and return a group descriptor that gives names to each level of the hierarchy of elements. Otherwise, it returns a group for the root element, whose next groups will match the depth of theITree
structure.- Returns:
- The collection of group descriptors for this call graph, or
null
if there is no hierarchy of elements
-
getPalette
Weighted tree providers can provide a palette of styles for the data represented. By default, it uses a default palette of a few qualitative colors that will use the hash code of objects to assign a style- Returns:
- The palette for this data provider
-