org.openscience.nmrshiftdb.util
Class JcampToCMLSpectrumMapper

java.lang.Object
  extended by org.openscience.nmrshiftdb.util.JcampToCMLSpectrumMapper

public class JcampToCMLSpectrumMapper
extends java.lang.Object

Maps a JCamp spectrum to a CMLSpectrum

Author:
Tobias Helmus

Constructor Summary
JcampToCMLSpectrumMapper()
           
 
Method Summary
private static org.xmlcml.cml.element.CMLSpectrumData mapContData(org.jcamp.spectrum.Spectrum1D spectrum1d)
          Maps continuous data
static org.xmlcml.cml.element.CMLSpectrum mapJcampToCMLSpectrum(org.jcamp.spectrum.Spectrum spectrum, org.apache.turbine.util.RunData runData)
          Main method, responsible for calling the mapping methods and setting general settings
private static void mapNotes(org.jcamp.spectrum.Spectrum spectrum, org.xmlcml.cml.element.CMLSpectrum cmlSpectrum, org.apache.turbine.util.RunData runData)
          Map the notes/metadata
private static org.xmlcml.cml.element.CMLPeakList mapPeaks(org.jcamp.spectrum.Spectrum1D spectrum1d)
          Maps the peak list
static java.lang.String sanitize(java.lang.String key)
          Ensures the output has the pattern "[A-Za-z][A-Za-z0-9_\.\-]*".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JcampToCMLSpectrumMapper

public JcampToCMLSpectrumMapper()
Method Detail

mapJcampToCMLSpectrum

public static org.xmlcml.cml.element.CMLSpectrum mapJcampToCMLSpectrum(org.jcamp.spectrum.Spectrum spectrum,
                                                                       org.apache.turbine.util.RunData runData)
Main method, responsible for calling the mapping methods and setting general settings

Parameters:
spectrum - the JCamp spectrum
Returns:
the CMLSpectrum element

mapPeaks

private static org.xmlcml.cml.element.CMLPeakList mapPeaks(org.jcamp.spectrum.Spectrum1D spectrum1d)
Maps the peak list

Parameters:
spectrum1d - the JCamp spectrum1d
Returns:
a CMLPeakList element

mapNotes

private static void mapNotes(org.jcamp.spectrum.Spectrum spectrum,
                             org.xmlcml.cml.element.CMLSpectrum cmlSpectrum,
                             org.apache.turbine.util.RunData runData)
Map the notes/metadata

Parameters:
spectrum - the JCamp spectrum
cmlSpectrum -

mapContData

private static org.xmlcml.cml.element.CMLSpectrumData mapContData(org.jcamp.spectrum.Spectrum1D spectrum1d)
Maps continuous data

Parameters:
spectrum1d - the JCamp spectrum1d
Returns:
a CMLSpectrumData element

sanitize

public static java.lang.String sanitize(java.lang.String key)
Ensures the output has the pattern "[A-Za-z][A-Za-z0-9_\.\-]*".

Parameters:
key -
Returns: