Class VariationTreeNode<L extends Label>

java.lang.Object
org.variantsync.diffdetective.variation.tree.VariationNode<VariationTreeNode<L>,L>
org.variantsync.diffdetective.variation.tree.VariationTreeNode<L>
All Implemented Interfaces:
HasNodeType

public class VariationTreeNode<L extends Label> extends VariationNode<VariationTreeNode<L>,L>
A single node in a variation tree.

A variation tree is a representation of source code in a software product line. Each node in such a tree is either an artifact or a mapping node. Artifacts represent source code which may be reused in multiple variants. In contrast, mappings do not contain source code of a specific variant. They store information about which variants contain the artifacts it has as children in the form of a feature mapping.

See definition 2.2 of our ESEC/FSE'22 paper for a mathematical formalization or variation trees. In contrast to this formalization, this implementation optimizes for variation trees obtained from source code annotated with the C preprocessor syntax. This mostly means that there is the additional NodeType.ELIF node type.

This class contains references to all of its children and its parent so all connected nodes of a variation tree can be reached through each node of the variation tree. Nevertheless, most of the time only node itself or its subtree (the reflexive hull of getChildren()) is meant when when referencing a VariationTreeNode. Use VariationTree to unambiguously refer to a whole variation tree.

If possible, algorithms should be using VariationNode instead of this concrete implementation. This allows the usage of a projection of a DiffNode instead of a concrete variation node.

To compare two variation trees use VariationDiff which uses the aforementioned DiffNodes.

Author:
Benjamin Moosherr
See Also: