java.lang.Object
org.eclipse.tracecompass.incubator.analysis.core.weighted.tree.WeightedTreeSet<N,E>
Type Parameters:
N - The type of objects represented by each node in the tree
E - The type of elements used to group the trees. If this type extends ITree, then the elements and their associated weighted trees will be grouped in a hierarchical style
All Implemented Interfaces:
IWeightedTreeSet<N,E,WeightedTree<N>>

public class WeightedTreeSet<@NonNull N,E> extends Object implements IWeightedTreeSet<N,E,WeightedTree<N>>
An implementation of the weighted tree set, with generic types and nodes
Author:
Geneviève Bastien
  • Constructor Details

    • WeightedTreeSet

      public WeightedTreeSet()
  • Method Details

    • getElements

      public Collection<E> 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,E,WeightedTree<N>>
      Returns:
      The elements used to group the trees
    • getTreesFor

      public Collection<@NonNull WeightedTree<N>> getTreesFor(Object element)
      Description copied from interface: IWeightedTreeSet
      Get the weighted trees for a given element
      Specified by:
      getTreesFor in interface IWeightedTreeSet<N,E,WeightedTree<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(E dstGroup, WeightedTree<@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)