Class Association
java.lang.Object
org.variantsync.boosting.datastructure.Association
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 Summary
ConstructorsConstructorDescriptionAssociation
(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. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getAll()
Returns the set off all modules.Returns the set of AST nodes contained in this EccoSet.org.logicng.formulas.Formula
Returns the feature mapping formula associated with this object.getMax()
Returns the set of max module.getMin()
Returns the set of min modules.getNot()
Returns the set of not modules.Returns a list of the smallest max modules.Returns a list of the smallest min modules.int
hashCode()
boolean
isBasic()
Returns whether the association tracks base code.void
removeNodes
(CustomHashSet<ASTNode> toRemove) Removes the specified nodes from the current set of AST nodes.void
setAll
(CustomHashSet<Module> all) Sets the all modules.void
Define this association as tracking base code.void
setMapping
(org.logicng.formulas.Formula mapping) Sets the feature mapping for the association.void
setMax
(CustomHashSet<Module> max) Sets the max modules.void
setMin
(CustomHashSet<Module> min) Sets the min modules.void
setNot
(CustomHashSet<Module> not) Sets the not modules.
-
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 modulesall
- the set of all modulesmax
- the maximum set of modulesnot
- the set of modules that are not in the associationastNodes
- the set of AST nodes associated with the modules
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
getAstNodes
Returns the set of AST nodes contained in this EccoSet.- Returns:
- a set of ASTNode objects representing the AST nodes
-
removeNodes
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
Returns the set of min modules.- Returns:
- the min modules
-
getAll
Returns the set off all modules.- Returns:
- the all modules
-
getMax
Returns the set of max module.- Returns:
- the max modules
-
getNot
Returns the set of not modules.- Returns:
- the not modules
-
getSmallestMinModules
Returns a list of the smallest min modules.- Returns:
- The list of smallest min modules
-
getSmallestMaxModules
Returns a list of the smallest max modules.- Returns:
- The list of smallest max modules
-
setMin
Sets the min modules.- Parameters:
min
- a set of min modules
-
setAll
Sets the all modules.- Parameters:
all
- a set of all modules
-
setMax
Sets the max modules.- Parameters:
max
- a set of max modules
-
setNot
Sets the not modules.- Parameters:
not
- a set of not modules
-
setBasic
Define this association as tracking base code. -
isBasic
public boolean isBasic()Returns whether the association tracks base code.
-