Class DifferentialWeightedTreeSet<N>

java.lang.Object
org.eclipse.tracecompass.incubator.analysis.core.weighted.tree.diff.DifferentialWeightedTreeSet<N>
Type Parameters:
N - The type of objects represented by each node in the tree
All Implemented Interfaces:
IWeightedTreeSet<N,Object,DifferentialWeightedTree<N>>

public class DifferentialWeightedTreeSet<@NonNull N> extends Object implements IWeightedTreeSet<N,Object,DifferentialWeightedTree<N>>
A treeset for differential weighted trees.
Author:
Geneviève Bastien
  • Constructor Details

  • Method Details

    • create

      public static <@NonNull N> DifferentialWeightedTreeSet<@NonNull N> create(Collection<DifferentialWeightedTree<@NonNull N>> trees)
      Create a differential weighted tree set containing a unique default element and the trees in parameters.
      Type Parameters:
      N - The type of objects represented by each node in the tree
      Parameters:
      trees - The differential weighted trees for the single element
      Returns:
      The differential flame graph with a default element containing the trees in parameter
    • getElements

      public Collection<Object> getElements()
      Description copied from interface: IWeightedTreeSet
      Get the elements under which are the weighted trees. It can be a single constant element if this treeset does not have the concept of grouping the trees.
      Specified by:
      getElements in interface IWeightedTreeSet<N,Object,DifferentialWeightedTree<N>>
      Returns:
      The elements used to group the trees
    • getTreesFor

      public Collection<@NonNull DifferentialWeightedTree<N>> getTreesFor(Object element)
      Description copied from interface: IWeightedTreeSet
      Get the weighted trees for a given element
      Specified by:
      getTreesFor in interface IWeightedTreeSet<N,Object,DifferentialWeightedTree<N>>
      Parameters:
      element - The element for which to get the trees
      Returns:
      A collection of weighted trees for the requested element
    • addWeightedTree

      public void addWeightedTree(Object dstGroup, DifferentialWeightedTree<@NonNull N> tree)
      Add a weighted tree for an element in this set. If a tree for the same object already exists, their data will be merged.
      Parameters:
      dstGroup - The group to which to add this tree
      tree - The weighted tree to add to this set. This tree may be modified and merged with others, so it should not be a tree that is part of another tree (for groupings or diff or other operations for instance)