java.lang.Object
org.variantsync.diffdetective.variation.tree.view.TreeView

public final class TreeView extends Object
This class groups the implementations for functions that generate views on variation trees, as described in Chapter 3 of our SPLC'23 paper - Views on Edits to Variational Software.
  • Constructor Details

    • TreeView

      private TreeView()
      Private constructor to prevent instantiation.
  • Method Details

    • treeInline

      public static <TreeNode extends VariationNode<TreeNode, ?>> void treeInline(TreeNode v, Predicate<TreeNode> inView)
      Mutates a variation tree inplace to a view on itself. Assuming that the given node v is the root of a variation tree, v will be the root of a view on that variation tree after running this procedure.
      Type Parameters:
      TreeNode - he type of the nodes within the given tree.
      Parameters:
      v - The root of the tree to turn into a view on itself.
      inView - A predicate that determines for each node whether it should be within the view or not.
    • treeInline

      public static <L extends Label> void treeInline(VariationTree<L> t, Relevance r)
      Mutates a variation tree inplace to a view on itself. After running this procedure, the given variation tree t will represent a view.
      Parameters:
      t - The variation tree to turn into a view.
      r - A relevance predicate that determines for each node in the tree whether it should be contained in the view or should be excluded. Will not be altered by running this procedure.
    • tree

      public static VariationTree<?> tree(VariationTree<?> t, Relevance r)
      Creates a view on the given variation tree as described by the given relevance predicate. This function is side-effect free. Thre given variation tree and relevance will not be altered. This function corresponds to Equation 4 in our SPLC'23 paper - Views on Edits to Variational Software.
      Parameters:
      t - The variation tree to generate a view on.
      r - A relevance predicate that determines for each node in the tree whether it should be contained in the view or should be excluded.
      Returns:
      A variation tree that represents a view on the given variation tree t.