Interface MapProposal<T,P,E extends MapEntry<T,P>>

All Known Subinterfaces:
ModuleMapProposal, RegionMapProposal, SectionMapProposal

public interface MapProposal<T,P,E extends MapEntry<T,P>>
  • Method Summary

    Modifier and Type
    Method
    Description
    Compute the overall map given by this proposal
    double
    Compute a notional "score" of the proposal
    static <T, P, E extends MapEntry<T, P>, M extends MapProposal<T, P, E>>
    Collection<E>
    flatten(Collection<M> proposals)
    Flatten proposals into a single collection of entries
    Get the corresponding program image of this proposal
    getToObject(T from)
    Get the destination (program) object for a given source (trace) object
    Get the trace containing the trace objects in this proposal
    static <E extends MapEntry<?, ?>>
    Set<E>
    Remove entries from a collection which overlap existing entries in the trace
  • Method Details

    • flatten

      static <T, P, E extends MapEntry<T, P>, M extends MapProposal<T, P, E>> Collection<E> flatten(Collection<M> proposals)
      Flatten proposals into a single collection of entries

      The output is suitable for use in DebuggerStaticMappingService.addMappings(Collection, TaskMonitor, boolean, String). In some contexts, the user should be permitted to see and optionally adjust the collection first.

      Note, it is advisable to filter the returned collection using removeOverlapping(Collection) to avoid errors from adding overlapped mappings. Alternatively, you can set truncateExisting to true when calling DebuggerStaticMappingService.addMappings(Collection, TaskMonitor, boolean, String).

      Parameters:
      proposals - the collection of proposed maps
      Returns:
      the flattened, filtered collection
    • removeOverlapping

      static <E extends MapEntry<?, ?>> Set<E> removeOverlapping(Collection<E> entries)
      Remove entries from a collection which overlap existing entries in the trace
      Parameters:
      entries - the entries to filter
      Returns:
      the filtered entries
    • getTrace

      Trace getTrace()
      Get the trace containing the trace objects in this proposal
      Returns:
      the trace
    • getProgram

      Program getProgram()
      Get the corresponding program image of this proposal
      Returns:
      the program
    • getToObject

      P getToObject(T from)
      Get the destination (program) object for a given source (trace) object
      Parameters:
      from - the trace object
      Returns:
      the proposed program object
    • computeScore

      double computeScore()
      Compute a notional "score" of the proposal

      This may examine attributes of the "from" and "to" objects, in order to determine the likelihood of the match based on this proposal. The implementation need not assign meaning to any particular score, but a higher score must imply a more likely match.

      Returns:
      a score of the proposed pair
    • computeMap

      Map<T,E> computeMap()
      Compute the overall map given by this proposal
      Returns:
      the map