Class IdHistogram

java.lang.Object
ghidra.features.bsim.query.client.IdHistogram
All Implemented Interfaces:
Comparable<IdHistogram>

public class IdHistogram extends Object implements Comparable<IdHistogram>
Lightweight object container of an LSHVector and its count within a collection of functions (database/executable) TODO: This should likely be merged with SignatureRecord
  • Field Details

    • id

      public long id
    • count

      public int count
    • vec

      public LSHVector vec
  • Constructor Details

    • IdHistogram

      public IdHistogram()
  • Method Details

    • compareTo

      public int compareTo(IdHistogram o)
      Specified by:
      compareTo in interface Comparable<IdHistogram>
    • buildVectorIdHistogram

      public static TreeSet<IdHistogram> buildVectorIdHistogram(Iterator<FunctionDescription> iter)
      Parameters:
      iter - is iterator over functions whose vectors are to be histogrammed
      Returns:
      the sorted list of pairs (hash,count)
    • collectVectors

      public static Set<IdHistogram> collectVectors(DescriptionManager manage, Iterator<FunctionDescription> iter)
      Organize/histogram LSHVectors by hash. Take into account functions that don't have a vector. Record hashes in the FunctionDescription's SignatureRecord
      Parameters:
      manage - is the container of the FunctionDescriptions
      iter - is the iterator over the FunctionDescriptions being collected
      Returns:
      the histogram as a set of (id,count,vec) triples