Class Association

java.lang.Object
org.variantsync.boosting.datastructure.Association

public class Association extends Object
Represents an association between modules and AST nodes. An association consists of the following components: - A set of AST nodes (astNodes) representing the code elements involved in the association - Three sets of modules (min, all, max) representing the minimum, all, and maximum products in which the association appears - A set of modules (not) representing the products in which the association does not appear - A boolean flag (isBasic) indicating whether the association appears in all products - A formula (mapping) representing the mapping between the modules and AST nodes This class provides methods for accessing and modifying the components of the association, such as: - Getting and setting the AST nodes, modules, and mapping - Removing specific AST nodes from the association - Getting the smallest modules in the association based on their size - Checking if the association is basic The equals and hashCode methods are overridden to ensure proper comparison of association objects based on their components.
  • Constructor Details

    • Association

      public Association(CustomHashSet<Module> min, CustomHashSet<Module> all, CustomHashSet<Module> max, CustomHashSet<Module> not, CustomHashSet<ASTNode> astNodes)
      Constructs a new Association with the specified sets of modules and AST nodes.
      Parameters:
      min - the minimum set of modules
      all - the set of all modules
      max - the maximum set of modules
      not - the set of modules that are not in the association
      astNodes - the set of AST nodes associated with the modules
  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getAstNodes

      public CustomHashSet<ASTNode> getAstNodes()
      Returns the set of AST nodes contained in this EccoSet.
      Returns:
      a set of ASTNode objects representing the AST nodes
    • removeNodes

      public void removeNodes(CustomHashSet<ASTNode> toRemove)
      Removes the specified nodes from the current set of AST nodes.
      Parameters:
      toRemove - The set of nodes to be removed from the current set of AST nodes.
      Throws:
      NullPointerException - if the specified set of nodes to be removed is null.
    • getMapping

      public org.logicng.formulas.Formula getMapping()
      Returns the feature mapping formula associated with this object.
      Returns:
      the mapping formula
    • setMapping

      public void setMapping(org.logicng.formulas.Formula mapping)
      Sets the feature mapping for the association.
      Parameters:
      mapping - the formula to set as the mapping
    • getMin

      public CustomHashSet<Module> getMin()
      Returns the set of min modules.
      Returns:
      the min modules
    • getAll

      public CustomHashSet<Module> getAll()
      Returns the set off all modules.
      Returns:
      the all modules
    • getMax

      public CustomHashSet<Module> getMax()
      Returns the set of max module.
      Returns:
      the max modules
    • getNot

      public CustomHashSet<Module> getNot()
      Returns the set of not modules.
      Returns:
      the not modules
    • getSmallestMinModules

      public List<Module> getSmallestMinModules()
      Returns a list of the smallest min modules.
      Returns:
      The list of smallest min modules
    • getSmallestMaxModules

      public List<Module> getSmallestMaxModules()
      Returns a list of the smallest max modules.
      Returns:
      The list of smallest max modules
    • setMin

      public void setMin(CustomHashSet<Module> min)
      Sets the min modules.
      Parameters:
      min - a set of min modules
    • setAll

      public void setAll(CustomHashSet<Module> all)
      Sets the all modules.
      Parameters:
      all - a set of all modules
    • setMax

      public void setMax(CustomHashSet<Module> max)
      Sets the max modules.
      Parameters:
      max - a set of max modules
    • setNot

      public void setNot(CustomHashSet<Module> not)
      Sets the not modules.
      Parameters:
      not - a set of not modules
    • setBasic

      public void setBasic(Boolean basicCode)
      Define this association as tracking base code.
    • isBasic

      public boolean isBasic()
      Returns whether the association tracks base code.