Class JDXDecompressor

java.lang.Object
jspecview.source.JDXDecompressor
All Implemented Interfaces:
Iterator<Double>

public class JDXDecompressor extends Object implements Iterator<Double>
JDXDecompressor contains static methods to decompress the data part of JCAMP-DX spectra that have been compressed using DIF, FIX, SQZ or PAC formats. If you wish to parse the data from XY formats see Coordinate.parseDSV(java.lang.String, double, double)
Author:
Christopher Muir, Debbie-Ann Facey, Khari A. Bryan, Prof Robert J. Lancashire, Bob Hanson - hansonr@stolaf.edu
  • Constructor Details

    • JDXDecompressor

      public JDXDecompressor(JDXSourceStreamTokenizer t, double firstX, double lastX, double xFactor, double yFactor, int nPoints)
      Initialises the JDXDecompressor from the compressed data, the x factor, the y factor and the deltaX value
      Parameters:
      t - the data to be decompressed
      firstX - first x listed in file
      lastX - the last X listed in file
      xFactor - the x factor
      yFactor - the y factor
      nPoints - the expected number of points
    • JDXDecompressor

      public JDXDecompressor(String line, int lastY)
  • Method Details

    • getMinY

      public double getMinY()
    • getMaxY

      public double getMaxY()
    • decompressData

      public Coordinate[] decompressData(SB errorLog)
      Determines the type of compression, decompresses the data and stores coordinates in an array to be returned
      Parameters:
      errorLog -
      Returns:
      the array of Coordinates
    • getNPointsFound

      public int getNPointsFound()
      Report out the number of points found (for error reporting)
      Returns:
      the number of points found
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<Double>
    • next

      public Double next()
      Specified by:
      next in interface Iterator<Double>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<Double>