Class MatchedFunctionComparisonModel
java.lang.Object
ghidra.features.base.codecompare.model.AbstractFunctionComparisonModel
ghidra.features.base.codecompare.model.MatchedFunctionComparisonModel
- All Implemented Interfaces:
FunctionComparisonModel
A FunctionComparisonModel comprised of matched pairs of source and target functions. Each
source function has its own set of target functions that it can be compared with.
-
Field Summary
Fields inherited from class ghidra.features.base.codecompare.model.AbstractFunctionComparisonModel
activeFunctions, FUNCTION_COMPARATOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new comparison to the model.protected boolean
containsFunction
(Duo.Side side, Function function) getFunctions
(Duo.Side side) Returns the list of all functions on the given side that could be made active.boolean
isEmpty()
Returns true if the model has no function to compare.void
removeFunction
(Function function) Removes the given function from all comparisons in the model, whether stored as a source or targetvoid
removeFunctions
(Program program) Removes all functions in the model that come from the given programvoid
removeFunctions
(Collection<Function> functions) Removes all the given functions from all comparisons in the modelboolean
setActiveFunction
(Duo.Side side, Function function) Sets the function for the given side.Methods inherited from class ghidra.features.base.codecompare.model.AbstractFunctionComparisonModel
addFunctionComparisonModelListener, fireModelDataChanged, getActiveFunction, removeFunctionComparisonModelListener
-
Constructor Details
-
MatchedFunctionComparisonModel
public MatchedFunctionComparisonModel()
-
-
Method Details
-
removeFunction
Removes the given function from all comparisons in the model, whether stored as a source or target- Parameters:
function
- the function to remove
-
removeFunctions
Removes all the given functions from all comparisons in the model- Parameters:
functions
- the functions to remove
-
removeFunctions
Removes all functions in the model that come from the given program- Parameters:
program
- the program to remove functions from
-
getFunctions
Description copied from interface:FunctionComparisonModel
Returns the list of all functions on the given side that could be made active.- Parameters:
side
- the side to get functions for- Returns:
- the list of all functions on the given side that could be made active
-
setActiveFunction
Description copied from interface:FunctionComparisonModel
Sets the function for the given side. The function must be one of the functions from that side's set of functions- Specified by:
setActiveFunction
in interfaceFunctionComparisonModel
- Overrides:
setActiveFunction
in classAbstractFunctionComparisonModel
- Parameters:
side
- the side to set the function forfunction
- the function so set for the given side- Returns:
- true if the function was made active or false if the function does not exist for the given side
-
getSourceFunctions
-
isEmpty
public boolean isEmpty()Description copied from interface:FunctionComparisonModel
Returns true if the model has no function to compare.- Returns:
- true if the model has no functions to compare
-
addMatch
Adds a new comparison to the model. If the sourceFunction already exists on the left side, then the target function will be added to that specific function's right side functions. Otherwise, the source function will be added to the left side the given target as its only right side function.- Parameters:
sourceFunction
- the left side function to addtargetFunction
- the right side function to add for that source function
-
containsFunction
- Specified by:
containsFunction
in classAbstractFunctionComparisonModel
-