Class Spectrum

java.lang.Object
eu.bandm.tools.message.Spectrum

public class Spectrum extends Object
A sequence of ascending non-overlapping, non-adjacent locations, maintained seperately for each document id. Points and Regions can be added. They will be merged as far as possible.

NB: The class has no length information about the lines of the target documents, so one region ending at "(docX, line n, column 1000)" and the other starting at "(docX, line n+1, 0)" cannot be merged.

  • Field Details

  • Constructor Details

    • Spectrum

      public Spectrum()
  • Method Details

    • getDocIds

      public Set<Object> getDocIds()
      Returns the set of all document ids occuring.
    • getLocations

      @Opt public @Opt List<Location<Object>> getLocations(Object docId)
      Returns the list of all locations in the given document. Is sorted ascending.
    • add

      public void add(Location<?>... locs)
      Add locations and merge them with others, if appropriate.
    • add

      public void add(Collection<Location<?>> locs)
      Add locations and merge them with others, if appropriate.
    • dump

      public void dump(PrintStream p)
      Print a debugging output of all locations.