Class SFQueryInfo

java.lang.Object
ghidra.features.bsim.query.facade.SFQueryInfo

public class SFQueryInfo extends Object
A simple container object to hold information that is to be sent to a database server as part of a query to find functions that are similar to those given in the constructor of this class. For a list of configurable parameters, see the setter methods of this class.
  • Field Details

    • DEFAULT_QUERIES_PER_STAGE

      public static final int DEFAULT_QUERIES_PER_STAGE
      The number of queries to make for the given set of functions. For example, if 100 functions are submitted and the number of stages is 10, then 10 queries will be made to the server, with 10 functions per request.

      This defaults to 1, which means to send all functions in one query.

      See Also:
  • Constructor Details

    • SFQueryInfo

      public SFQueryInfo(Set<FunctionSymbol> functions)
      Constructs a query request with default parameters.
      Parameters:
      functions - required--a set of functions (at least one) for which similar functions will searched. All functions must be from the same program.
      Throws:
      IllegalArgumentException - if functions is null/empty or functions are from multiple programs.
  • Method Details

    • getProgram

      public Program getProgram()
      Returns:
      the program from which all queried functions are from
    • getSimilarityThreshold

      public double getSimilarityThreshold()
      Gets the threshold under which a potential similar function will not be matched. This threshold is for how similar the potential function is. This is a value from 0.0 to 1.0. The default value is 0.7.
      Returns:
      threshold under which a potential similar function will not be matched.
    • setSimilarityThreshold

      public void setSimilarityThreshold(double similarityThreshold)
      Parameters:
      similarityThreshold - the new threshold
      See Also:
    • getSignificanceThreshold

      public double getSignificanceThreshold()
      Gets the threshold under which a potential similar function will not be matched. This threshold is for how significant the match is (for example, smaller function matches are less significant). Higher is more significant. There is no upper bound. The default value is 0.0.
      Returns:
      threshold under which a potential similar function will not be matched.
    • setSignificanceThreshold

      public void setSignificanceThreshold(double significanceThreshold)
      Parameters:
      significanceThreshold - the new threshold
      See Also:
    • getMaximumResults

      public int getMaximumResults()
      The maximum number of similar functions to return for a given input function The default value is 100.
      Returns:
      The maximum number of similar functions to return
    • setMaximumResults

      public void setMaximumResults(int maximumResults)
      Parameters:
      maximumResults - the new maximum
      See Also:
    • buildQueryNearest

      public QueryNearest buildQueryNearest()
    • getFunctions

      public Set<FunctionSymbol> getFunctions()
      Returns the input functions for which matches will be searched.
      Returns:
      the input functions for which matches will be searched.
    • setFunctions

      public void setFunctions(Set<FunctionSymbol> functions)
      Sets the input functions for which matches will be searched.
      Parameters:
      functions - the input functions for which matches will be searched.
    • getBsimFilter

      public BSimFilter getBsimFilter()
    • getPreFilter

      public PreFilter getPreFilter()
    • getFilterInfoStrings

      public Collection<String> getFilterInfoStrings()
    • getNumberOfStages

      public int getNumberOfStages(int queries_per_stage)
      The number of queries to make for the given set of functions. For example, if 100 functions are submitted and the number of stages is 10, then 10 queries will be made to the server, with 10 functions per request.

      This defaults to 1, which means to send all functions in one query.

      Parameters:
      queries_per_stage - how many queries to initiate per stage
      Returns:
      the number of queries to make for the given set of functions.
    • toString

      public String toString()
      Overrides:
      toString in class Object